Просмотр исходного кода

Refactor a few things in the makefiles.

This fixes the path to source files in some unit tests and allows
to get rid of a few duplicate lines.
tags/v0.99.beta20
Sam Hocevar 8 лет назад
Родитель
Сommit
2f1ca4a550
20 измененных файлов: 67 добавлений и 51 удалений
  1. +1
    -1
      .travis/before_install.sh
  2. +2
    -0
      Makefile.am
  3. +6
    -0
      build/autotools/common.am
  4. +2
    -0
      caca-sharp/Makefile.am
  5. +3
    -3
      caca/Makefile.am
  6. +1
    -1
      caca/t/Makefile.am
  7. +12
    -9
      caca/t/check-copyright
  8. +6
    -3
      caca/t/check-doxygen
  9. +11
    -8
      caca/t/check-source
  10. +4
    -3
      caca/t/check-win32
  11. +1
    -3
      cxx/Makefile.am
  12. +2
    -0
      doc/Makefile.am
  13. +1
    -3
      examples/Makefile.am
  14. +2
    -2
      java/Makefile.am
  15. +2
    -3
      kernel/Makefile.am
  16. +3
    -2
      python/Makefile.am
  17. +2
    -2
      ruby/Makefile.am
  18. +3
    -4
      src/Makefile.am
  19. +1
    -4
      tools/Makefile.am
  20. +2
    -0
      win32/Makefile.am

+ 1
- 1
.travis/before_install.sh Просмотреть файл

@@ -2,6 +2,6 @@

if brew --version 2>/dev/null 2>&1; then
# FIXME: no ncurses formula for now; also add ruby
brew install slang doxygen
brew install slang doxygen
fi


+ 2
- 0
Makefile.am Просмотреть файл

@@ -1,4 +1,6 @@

include $(top_srcdir)/build/autotools/common.am

SUBDIRS = kernel caca src examples tools \
cxx caca-sharp python ruby java doc
DIST_SUBDIRS = $(SUBDIRS) win32


+ 6
- 0
build/autotools/common.am Просмотреть файл

@@ -0,0 +1,6 @@

AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/caca -I$(top_builddir)/caca

echo-topdir: ; echo $(top_srcdir)
echo-sources: ; echo $(SOURCES) $(EXTRA_CHECKS)


+ 2
- 0
caca-sharp/Makefile.am Просмотреть файл

@@ -1,4 +1,6 @@

include $(top_srcdir)/build/autotools/common.am

# We need to install the .config file ourselves because of a gacutil
# bug (https://bugzilla.novell.com/show_bug.cgi?id=363341)
monodir = $(libdir)/mono/caca-sharp-0.0


+ 3
- 3
caca/Makefile.am Просмотреть файл

@@ -1,4 +1,6 @@

include $(top_srcdir)/build/autotools/common.am

SUBDIRS = . t

EXTRA_DIST = caca.pc.in \
@@ -6,7 +8,7 @@ EXTRA_DIST = caca.pc.in \
libcaca.vcxproj libcaca.def
DISTCLEANFILES = caca.pc

AM_CPPFLAGS = -I$(top_srcdir) -DPLUGINDIR=\"$(plugindir)\"
AM_CPPFLAGS += -DPLUGINDIR=\"$(plugindir)\"

pkgconfig_DATA = caca.pc
pkgconfigdir = $(libdir)/pkgconfig
@@ -108,5 +110,3 @@ if USE_COCOA
driver_source += driver/cocoa.m
endif

echo-sources: ; echo $(SOURCES)


+ 1
- 1
caca/t/Makefile.am Просмотреть файл

@@ -1,5 +1,5 @@

AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/caca -I..
include $(top_srcdir)/build/autotools/common.am

if USE_CPPUNIT
cppunit_tests = caca-test


+ 12
- 9
caca/t/check-copyright Просмотреть файл

@@ -1,27 +1,30 @@
#!/bin/sh

export MAKEFLAGS=""
top_srcdir="$(make -s echo-topdir)"

#
# Check that the copyright information is valid
#
nfails=0
nfiles=0
for dir in $(make -s echo-dirs -C ..); do
if [ ! -d "../$dir" ]; then continue; fi
for x in $(make -s echo-sources -C ../$dir); do
for dir in $(make -s echo-dirs -C "${top_srcdir}"); do
if [ ! -d "${top_srcdir}/${dir}" ]; then continue; fi
for x in $(make -s echo-sources -C "${top_srcdir}/${dir}"); do
case "$x" in
*.c|*.cpp|*.h|*.m|*.php|*.cs|*.java|.py|.pl)
nfiles=$(($nfiles + 1)) ;;
*)
continue ;;
esac
if ! grep 'Copyright *([cC])' "../$dir/$x" >/dev/null 2>&1; then
echo "error: $dir/$x lacks proper copyright information"
if ! grep 'Copyright *([cC])' "${top_srcdir}/${dir}/$x" >/dev/null 2>&1; then
echo "error: ${dir}/$x lacks proper copyright information"
nfails=$(($nfails + 1))
elif [ -d ../.git ]; then
Y="$(git log "../$dir/$x" | head -n 3 | sed -ne 's/^Date.* \([0-9][0-9][0-9][0-9]\) .*/\1/p')"
elif [ -d ../../.git ]; then
Y="$(git log "${top_srcdir}/${dir}/$x" | head -n 3 | sed -ne 's/^Date.* \([0-9][0-9][0-9][0-9]\) .*/\1/p')"
if [ "$Y" != "" ]; then
if ! grep "$Y.*@" "../$dir/$x" >/dev/null 2>&1; then
echo "error: $dir/$x last modified in $Y, which is not in copyright"
if ! grep "$Y.*@" "${top_srcdir}/${dir}/$x" >/dev/null 2>&1; then
echo "error: ${dir}/$x last modified in $Y, which is not in copyright"
nfails=$(($nfails + 1))
fi
fi


+ 6
- 3
caca/t/check-doxygen Просмотреть файл

@@ -1,11 +1,14 @@
#!/bin/sh

export MAKEFLAGS=""
top_srcdir="$(make -s echo-topdir 2>/dev/null)"

#
# Check for Doxygen warnings
#
nfiles="$(grep -c "Parsing file" < ../../doc/doxygen.log)"
if nfails="$(grep -c Warning: ../../doc/doxygen.log 2>/dev/null)"; then
grep Warning: ../../doc/doxygen.log | sed 's/\(.\{75\}\)...*/\1 .../'
nfiles="$(grep -c "Parsing file" < "${top_srcdir}/doc/doxygen.log")"
if nfails="$(grep -c Warning: "${top_srcdir}/doc/doxygen.log" 2>/dev/null)"; then
grep Warning: "${top_srcdir}/doc/doxygen.log" | sed 's/\(.\{75\}\)...*/\1 .../'
fi

echo "$nfiles files, $nfails visible errors in documentation"


+ 11
- 8
caca/t/check-source Просмотреть файл

@@ -1,27 +1,30 @@
#!/bin/sh

export MAKEFLAGS=""
top_srcdir="$(make -s echo-topdir)"

#
# Check that we have no tabs or trailing spaces in the source code
#
nfails=0
nfiles=0
nlines=0
for dir in $(make -s echo-dirs -C ..); do
if [ ! -d "../$dir" ]; then continue; fi
for x in $(make -s echo-sources -C ../$dir); do
for dir in $(make -s echo-dirs -C "${top_srcdir}"); do
if [ ! -d "${top_srcdir}/${dir}" ]; then continue; fi
for x in $(make -s echo-sources -C "${top_srcdir}/${dir}"); do
case "$x" in
*.c|*.cpp|*.h|*.m|*.php|*.cs|*.java|*.py|*.pl)
nfiles=$(($nfiles + 1));
nlines=$(($nlines + `grep -c . "../$dir/$x"`)) ;;
nlines=$(($nlines + `grep -c . "${top_srcdir}/${dir}/$x"`)) ;;
*)
continue ;;
esac
if grep '[[:space:]]$' "../$dir/$x" >/dev/null 2>&1; then
echo "error: $dir/$x contains trailing spaces"
if grep '[[:space:]]$' "${top_srcdir}/${dir}/$x" >/dev/null 2>&1; then
echo "error: ${dir}/$x contains trailing spaces"
nfails=$(($nfails + 1))
fi
if grep ' ' "../$dir/$x" >/dev/null 2>&1; then
echo "error: $dir/$x contains tabs"
if grep ' ' "${top_srcdir}/${dir}/$x" >/dev/null 2>&1; then
echo "error: ${dir}/$x contains tabs"
nfails=$(($nfails + 1))
fi
done


+ 4
- 3
caca/t/check-win32 Просмотреть файл

@@ -1,13 +1,14 @@
#!/bin/sh

ret=0
export MAKEFLAGS=""
top_srcdir="$(make -s echo-topdir)"

#
# Check that the Win32 config.h is in sync with config.h.in
#

config_h_in=$(dirname "$0")/../config.h.in
win32_config_h=$(dirname "$0")/../win32/config.h
config_h_in="${top_srcdir}/config.h.in"
win32_config_h="${top_srcdir}/win32/config.h"

nfails=0
ntokens=0


+ 1
- 3
cxx/Makefile.am Просмотреть файл

@@ -1,5 +1,5 @@

AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/caca -I../caca
include $(top_srcdir)/build/autotools/common.am

EXTRA_DIST = libcaca++.vcxproj libcaca++.def test-cxx.vcxproj
if USE_CXX
@@ -31,5 +31,3 @@ uninstall-local:
rm -f $(DESTDIR)$(pkgconfigdir)/cucul++.pc
rmdir $(DESTDIR)$(pkgconfigdir) 2>/dev/null || true

echo-sources: ; echo $(SOURCES)


+ 2
- 0
doc/Makefile.am Просмотреть файл

@@ -1,4 +1,6 @@

include $(top_srcdir)/build/autotools/common.am

EXTRA_DIST = doxygen.cfg.in doxygen.css footer.html header.html \
$(man_MANS) $(doxygen_DOX)
CLEANFILES = doxygen.log stamp-latex stamp-doxygen


+ 1
- 3
examples/Makefile.am Просмотреть файл

@@ -1,5 +1,5 @@

AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/caca -I$(top_builddir)/caca
include $(top_srcdir)/build/autotools/common.am

noinst_PROGRAMS = trifiller blit canvas colors conio $(conio_snake) demo demo0 dithering driver event export figfont font font2tga frames fullwidth gamma hsv input spritedit swallow text transform truecolor unicode import mouse

@@ -96,5 +96,3 @@ import_LDADD = ../caca/libcaca.la
mouse_SOURCES = mouse.c
mouse_LDADD = ../caca/libcaca.la

echo-sources: ; echo $(SOURCES)


+ 2
- 2
java/Makefile.am Просмотреть файл

@@ -1,9 +1,9 @@

include $(top_srcdir)/build/autotools/common.am

jnidir = $(libdir)/jni
libcaca_javadir = $(datadir)/java

AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/caca -I../caca

java_jar = libjava.jar

if USE_JAVA


+ 2
- 3
kernel/Makefile.am Просмотреть файл

@@ -1,4 +1,6 @@

include $(top_srcdir)/build/autotools/common.am

EXTRA_DIST = bootsect.S

lib_LTLIBRARIES = $(libkernel_la)
@@ -13,11 +15,8 @@ libkernel_la_SOURCES = \
multiboot.h \
$(NULL)
libkernel_la_LDFLAGS = -no-undefined
AM_CPPFLAGS = -I$(top_srcdir)

clean: clean-local
clean-local:
rm -f bootsect.bin kern.bin kernel.map

echo-sources: ; echo $(SOURCES)


+ 3
- 2
python/Makefile.am Просмотреть файл

@@ -1,4 +1,6 @@

include $(top_srcdir)/build/autotools/common.am

if USE_PYTHON
cacadir = $(pythondir)/caca
caca_PYTHON = \
@@ -8,6 +10,7 @@ caca_PYTHON = \
caca/display.py \
caca/dither.py \
caca/font.py
EXTRA_CHECKS = $(caca_PYTHON)
endif

EXTRA_DIST = \
@@ -24,5 +27,3 @@ EXTRA_DIST = \
examples/gol.py \
examples/text.py

echo-sources: ; echo $(caca_PYTHON)


+ 2
- 2
ruby/Makefile.am Просмотреть файл

@@ -1,4 +1,6 @@

include $(top_srcdir)/build/autotools/common.am

rubylibdir = $(RUBY_SITEARCHDIR)
rubysitedir = $(RUBY_SITELIBDIR)

@@ -38,5 +40,3 @@ EXTRA_DIST = ruby.dox \
README \
$(NULL)

echo-sources: ; echo $(SOURCES)


+ 3
- 4
src/Makefile.am Просмотреть файл

@@ -1,9 +1,10 @@

include $(top_srcdir)/build/autotools/common.am

pkgdata_DATA = caca.txt

EXTRA_DIST = caca.txt cacademo.vcxproj cacafire.vcxproj cacaview.vcxproj
AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/caca -I../caca \
-DLIBCACA=1 -DX_DISPLAY_MISSING=1
AM_CPPFLAGS += -DLIBCACA=1 -DX_DISPLAY_MISSING=1

bin_PROGRAMS = cacademo cacafire cacaplay cacaview img2txt cacaclock $(fcntl_programs)
noinst_PROGRAMS = cacadraw
@@ -44,5 +45,3 @@ else
fcntl_programs =
endif

echo-sources: ; echo $(SOURCES)


+ 1
- 4
tools/Makefile.am Просмотреть файл

@@ -1,6 +1,5 @@

AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/caca -I../caca \
-I$(top_srcdir)/caca
include $(top_srcdir)/build/autotools/common.am

noinst_PROGRAMS = optipal sortchars $(pango_programs)

@@ -20,5 +19,3 @@ else
pango_programs =
endif

echo-sources: ; echo $(SOURCES)


+ 2
- 0
win32/Makefile.am Просмотреть файл

@@ -1,3 +1,5 @@

include $(top_srcdir)/build/autotools/common.am

EXTRA_DIST = config.h


Загрузка…
Отмена
Сохранить