From: Marko Kreen Date: Tue, 20 Dec 2011 21:27:08 +0000 (+0200) Subject: Update build tests X-Git-Url: http://git.postgresql.org/gitweb/?a=commitdiff_plain;h=23445c6ea9493b6a4470c36a771c11dc1a4b6cf2;p=libusual.git Update build tests --- diff --git a/mk/temos/expected/antimake1.txt b/mk/temos/expected/antimake1.txt index 9ee5165..91f4d75 100644 --- a/mk/temos/expected/antimake1.txt +++ b/mk/temos/expected/antimake1.txt @@ -63,10 +63,10 @@ Hello, world We can even install it already: --------------------------------- -$ make install prefix=/opt - INSTALL hello /opt/bin -$ ls /opt/bin -hello prog +$ make install prefix=/opt DESTDIR=./inst + INSTALL hello ./inst/opt/bin +$ ls ./inst/opt/bin +hello --------------------------------- For creating source package, we need to provide additional info: @@ -95,7 +95,7 @@ $ make dist COPY myhello-1.0 PACK myhello-1.0.tar.gz $ ls -Makefile antimake.mk hello hello.c myhello-1.0.tar.gz +Makefile antimake.mk hello hello.c inst myhello-1.0.tar.gz $ tar tzf myhello-1.0.tar.gz | sort myhello-1.0/ myhello-1.0/Makefile @@ -109,7 +109,7 @@ Clean the tree $ make clean CLEAN hello $ ls -Makefile antimake.mk hello.c myhello-1.0.tar.gz +Makefile antimake.mk hello.c inst myhello-1.0.tar.gz --------------------------------- Done! diff --git a/mk/temos/expected/antimake2.txt b/mk/temos/expected/antimake2.txt index abd4e87..971d171 100644 --- a/mk/temos/expected/antimake2.txt +++ b/mk/temos/expected/antimake2.txt @@ -22,10 +22,18 @@ $ cp ../../antimake.mk . Prepare sources +.File: api.h +[source,c] +----------------------------------- +void func1(void); +void func2(void); +void func3(void); +----------------------------------- .File: main.c [source,c] ----------------------------------- #include +#include "api.h" int main(void) { @@ -40,6 +48,7 @@ int main(void) [source,c] ----------------------------------- #include +#include "api.h" void func1(void) { @@ -50,6 +59,7 @@ void func1(void) [source,c] ----------------------------------- #include +#include "api.h" void func2(void) { @@ -60,6 +70,7 @@ void func2(void) [source,c] ----------------------------------- #include +#include "api.h" void func3(void) { @@ -93,6 +104,7 @@ SUBDIRS = sublib noinst_LIBRARIES = func1.a func1_a_SOURCES = func1.c +func1_a_CPPFLAGS = -I.. EXTRA_DIST = Makefile @@ -105,6 +117,7 @@ SUBLOC = lib1/sublib noinst_LIBRARIES = func2.a func2_a_SOURCES = func2.c +func2_a_CPPFLAGS = -I../.. EXTRA_DIST = Makefile @@ -117,6 +130,7 @@ SUBLOC = lib2 noinst_LIBRARIES = func3.a func3_a_SOURCES = func3.c +func3_a_CPPFLAGS = -I$(top_srcdir) EXTRA_DIST = Makefile @@ -148,7 +162,7 @@ $ make CC main.c CCLD prog $ ls -Makefile antimake.mk lib1 lib2 main.c prog +Makefile antimake.mk api.h lib1 lib2 main.c prog $ ./prog func1 func2 @@ -156,10 +170,10 @@ func3 main --------------------------------- -We can even install it already: +We can now install it: --------------------------------- -$ make install prefix=/opt +$ make install DESTDIR=./inst --> lib1 --> lib1/sublib make[2]: Nothing to be done for `install'. @@ -168,9 +182,9 @@ make[2]: Nothing to be done for `install'. --> lib2 make[1]: Nothing to be done for `install'. <-- lib2 - INSTALL prog /opt/bin -$ ls /opt/bin -hello prog + INSTALL prog ./inst/usr/local/bin +$ ls ./inst/usr/local/bin +prog --------------------------------- Now we can create package that can be given to others. @@ -182,7 +196,8 @@ $ make dist COPY test-subdirs-1.0 PACK test-subdirs-1.0.tar.gz $ ls -Makefile antimake.mk lib1 lib2 main.c prog test-subdirs-1.0.tar.gz +Makefile api.h lib1 main.c test-subdirs-1.0.tar.gz +antimake.mk inst lib2 prog $ tar tzf test-subdirs-1.0.tar.gz | sort test-subdirs-1.0/ test-subdirs-1.0/Makefile @@ -214,7 +229,7 @@ $ make clean <-- lib2 CLEAN prog $ ls -Makefile antimake.mk lib1 lib2 main.c test-subdirs-1.0.tar.gz +Makefile antimake.mk api.h inst lib1 lib2 main.c test-subdirs-1.0.tar.gz --------------------------------- Test O= @@ -243,7 +258,8 @@ $ make O=build CC ../main.c CCLD prog $ ls -Makefile antimake.mk build lib1 lib2 main.c test-subdirs-1.0.tar.gz +Makefile api.h inst lib2 test-subdirs-1.0.tar.gz +antimake.mk build lib1 main.c $ ls build Makefile antimake.mk lib1 lib2 prog --------------------------------- diff --git a/mk/temos/expected/antimake3.txt b/mk/temos/expected/antimake3.txt index 87dc7b2..484a745 100644 --- a/mk/temos/expected/antimake3.txt +++ b/mk/temos/expected/antimake3.txt @@ -103,6 +103,10 @@ Prepare sources ----------------------------------- #include +void func1(void); +void func2(void); +void func3(void); + int main(void) { func1(); @@ -209,13 +213,13 @@ func3 main --------------------------------- -We can even install it already: +We can now install it: --------------------------------- -$ make install prefix=/opt - INSTALL prog /opt/bin -$ ls /opt/bin -hello prog +$ make install prefix=/opt DESTDIR=./inst + INSTALL prog ./inst/opt/bin +$ ls ./inst/opt/bin +prog --------------------------------- Now we can create package that can be given to others. @@ -227,7 +231,8 @@ $ make dist COPY test-subdirs-1.0 PACK test-subdirs-1.0.tar.gz $ ls -Makefile antimake.mk lib1 lib2 main.c prog src test-subdirs-1.0.tar.gz +Makefile inst lib2 prog test-subdirs-1.0.tar.gz +antimake.mk lib1 main.c src $ tar tzf test-subdirs-1.0.tar.gz | sort test-subdirs-1.0/ test-subdirs-1.0/Makefile @@ -254,7 +259,7 @@ $ make clean CLEAN lib2/func3.a CLEAN clean $ ls -Makefile antimake.mk lib1 lib2 main.c src test-subdirs-1.0.tar.gz +Makefile antimake.mk inst lib1 lib2 main.c src test-subdirs-1.0.tar.gz --------------------------------- Done! diff --git a/mk/temos/expected/antimake4.txt b/mk/temos/expected/antimake4.txt index 4913888..849688c 100644 --- a/mk/temos/expected/antimake4.txt +++ b/mk/temos/expected/antimake4.txt @@ -7,10 +7,7 @@ Autoconf setup .File: autogen.sh [source,shell] ----------------------------------- -libtoolize -i -q -aclocal -I../../../m4 -autoconf -rm -rf autom4te.cache ltmain.sh aclocal.m4 +../../std-autogen.sh ../../.. # fetch Antimake template from libusual cp ../../antimake.mk antimake.mk.in diff --git a/mk/temos/expected/antimake5.txt b/mk/temos/expected/antimake5.txt index 59ce102..ef94b36 100644 --- a/mk/temos/expected/antimake5.txt +++ b/mk/temos/expected/antimake5.txt @@ -7,10 +7,7 @@ Autoconf setup .File: autogen.sh [source,shell] ----------------------------------- -libtoolize -i -q -aclocal -I../../../m4 -autoconf -rm -rf autom4te.cache aclocal.m4 +../../std-autogen.sh ../../.. # fetch Antimake template from libusual cp ../../antimake.mk antimake.mk.in @@ -47,6 +44,7 @@ int main(void) ----------------------------------- #include +void func1(void); void func1(void) { printf("hello from func1\n"); diff --git a/mk/temos/expected/antimake6.txt b/mk/temos/expected/antimake6.txt index 1bfdfd6..f0a1b5d 100644 --- a/mk/temos/expected/antimake6.txt +++ b/mk/temos/expected/antimake6.txt @@ -7,10 +7,7 @@ Autoconf setup .File: autogen.sh [source,shell] ----------------------------------- -libtoolize -i -q -aclocal -I../../../m4 -autoconf -rm -rf autom4te.cache aclocal.m4 +../../std-autogen.sh ../../.. # fetch Antimake template from libusual grep -Ei '@[a-z_]+@' ../../antimake.mk > build.mk.in @@ -116,6 +113,8 @@ Now fill makefiles SUBDIRS = sub EMBED_SUBDIRS = esub +override WFLAGS = -Wall + EXTRA_DIST = Makefile antimake.mk $(MAINTAINERCLEANFILES) # clean configured files @@ -389,28 +388,28 @@ Clean up --------------------------------- $ make maintainer-clean - CLEAN esub/libfunc4.a - CLEAN esub/esub/libfunc6.a - CLEAN cpptest - CLEAN esub/prog --> sub - CLEAN libfunc1.a - CLEAN esub/libfunc2.a --> sub/sub CLEAN libfunc3.a <-- sub/sub + CLEAN libfunc1.a + CLEAN esub/libfunc2.a CLEAN clean <-- sub --> esub/sub CLEAN libfunc5.a <-- esub/sub + CLEAN esub/libfunc4.a + CLEAN esub/esub/libfunc6.a + CLEAN cpptest + CLEAN esub/prog CLEAN clean --> sub - CLEAN libfunc1.a - CLEAN esub/libfunc2.a --> sub/sub CLEAN libfunc3.a <-- sub/sub + CLEAN libfunc1.a + CLEAN esub/libfunc2.a CLEAN clean --> sub/sub CLEAN libfunc3.a diff --git a/mk/temos/expected/libusual1.txt b/mk/temos/expected/libusual1.txt index c8b6490..2959397 100644 --- a/mk/temos/expected/libusual1.txt +++ b/mk/temos/expected/libusual1.txt @@ -19,11 +19,11 @@ done. $ cd lib $ ./autogen.sh [...] -$ ./configure --disable-shared --prefix=/home/marko/src/libusual/mk/temos/tmp/lib/../inst +$ ./configure --disable-shared --prefix=/opt [...] $ make [...] -$ make install +$ make install DESTDIR=`pwd`/../inst [...] $ cd .. --------------------------------- @@ -64,8 +64,8 @@ SRCS = prog.c OBJS = $(SRCS:.c=.o) # here we link to libusual -CPPFLAGS = -I./inst/include -LDFLAGS = -L./inst/lib +CPPFLAGS = -I./inst/opt/include +LDFLAGS = -L./inst/opt/lib LIBS = -lusual CC = gcc @@ -81,8 +81,8 @@ Build the project --------------------------------- $ make -gcc -O -g -Wall -I./inst/include -c -o prog.o prog.c -gcc -O -g -Wall -L./inst/lib prog.o -lusual -o prog +gcc -O -g -Wall -I./inst/opt/include -c -o prog.o prog.c +gcc -O -g -Wall -L./inst/opt/lib prog.o -lusual -o prog $ ls Makefile inst lib prog prog.c prog.o $ ./prog diff --git a/mk/temos/src/antimake1.temo b/mk/temos/src/antimake1.temo index a13d576..8c2742e 100644 --- a/mk/temos/src/antimake1.temo +++ b/mk/temos/src/antimake1.temo @@ -47,8 +47,8 @@ run ls run ./hello msg We can even install it already: -run make install prefix=/opt -run ls /opt/bin +run make install prefix=/opt DESTDIR=./inst +run ls ./inst/opt/bin msg For creating source package, we need to provide additional info: diff --git a/mk/temos/src/antimake2.temo b/mk/temos/src/antimake2.temo index c7144b4..79bc4ae 100644 --- a/mk/temos/src/antimake2.temo +++ b/mk/temos/src/antimake2.temo @@ -23,8 +23,15 @@ run cp ../../antimake.mk . msg Prepare sources +cat_file api.h <<"EOF" + void func1(void); + void func2(void); + void func3(void); +EOF + cat_file main.c <<"EOF" #include + #include "api.h" int main(void) { @@ -38,6 +45,7 @@ EOF cat_file lib1/func1.c <<"EOF" #include + #include "api.h" void func1(void) { @@ -47,6 +55,7 @@ EOF cat_file lib1/sublib/func2.c <<"EOF" #include + #include "api.h" void func2(void) { @@ -56,6 +65,7 @@ EOF cat_file lib2/func3.c <<"EOF" #include + #include "api.h" void func3(void) { @@ -86,6 +96,7 @@ cat_file lib1/Makefile <<"EOF" noinst_LIBRARIES = func1.a func1_a_SOURCES = func1.c + func1_a_CPPFLAGS = -I.. EXTRA_DIST = Makefile @@ -97,6 +108,7 @@ cat_file lib1/sublib/Makefile <<"EOF" noinst_LIBRARIES = func2.a func2_a_SOURCES = func2.c + func2_a_CPPFLAGS = -I../.. EXTRA_DIST = Makefile @@ -108,6 +120,7 @@ cat_file lib2/Makefile <<"EOF" noinst_LIBRARIES = func3.a func3_a_SOURCES = func3.c + func3_a_CPPFLAGS = -I$(top_srcdir) EXTRA_DIST = Makefile @@ -122,9 +135,9 @@ run make run ls run ./prog -msg We can even install it already: -run make install prefix=/opt -run ls /opt/bin +msg We can now install it: +run make install DESTDIR=./inst +run ls ./inst/usr/local/bin msg Now we can create package that can be given to others. run make dist diff --git a/mk/temos/src/antimake3.temo b/mk/temos/src/antimake3.temo index 8fd4b9b..b191f99 100644 --- a/mk/temos/src/antimake3.temo +++ b/mk/temos/src/antimake3.temo @@ -93,6 +93,10 @@ msg Prepare sources cat_file main.c <<"EOF" #include + void func1(void); + void func2(void); + void func3(void); + int main(void) { func1(); @@ -175,9 +179,9 @@ run make run ls run ./prog -msg We can even install it already: -run make install prefix=/opt -run ls /opt/bin +msg We can now install it: +run make install prefix=/opt DESTDIR=./inst +run ls ./inst/opt/bin msg Now we can create package that can be given to others. run make dist diff --git a/mk/temos/src/antimake4.temo b/mk/temos/src/antimake4.temo index d597511..da299a1 100644 --- a/mk/temos/src/antimake4.temo +++ b/mk/temos/src/antimake4.temo @@ -8,10 +8,7 @@ title Using Antimake with autoconf msg Autoconf setup cat_file autogen.sh <<"EOF" - libtoolize -i -q - aclocal -I../../../m4 - autoconf - rm -rf autom4te.cache ltmain.sh aclocal.m4 + ../../std-autogen.sh ../../.. # fetch Antimake template from libusual cp ../../antimake.mk antimake.mk.in diff --git a/mk/temos/src/antimake5.temo b/mk/temos/src/antimake5.temo index 8880681..a6c3c22 100644 --- a/mk/temos/src/antimake5.temo +++ b/mk/temos/src/antimake5.temo @@ -8,10 +8,7 @@ title Shared libraries and autoconf msg Autoconf setup cat_file autogen.sh <<"EOF" - libtoolize -i -q - aclocal -I../../../m4 - autoconf - rm -rf autom4te.cache aclocal.m4 + ../../std-autogen.sh ../../.. # fetch Antimake template from libusual cp ../../antimake.mk antimake.mk.in @@ -44,6 +41,7 @@ EOF cat_file func.c <<"EOF" #include + void func1(void); void func1(void) { printf("hello from func1\n"); diff --git a/mk/temos/src/antimake6.temo b/mk/temos/src/antimake6.temo index 3c3a256..aee99bd 100644 --- a/mk/temos/src/antimake6.temo +++ b/mk/temos/src/antimake6.temo @@ -8,10 +8,7 @@ title Antimake stress-test msg Autoconf setup cat_file autogen.sh <<"EOF" - libtoolize -i -q - aclocal -I../../../m4 - autoconf - rm -rf autom4te.cache aclocal.m4 + ../../std-autogen.sh ../../.. # fetch Antimake template from libusual grep -Ei '@[a-z_]+@' ../../antimake.mk > build.mk.in @@ -109,6 +106,8 @@ cat_file Makefile <<"EOF" SUBDIRS = sub EMBED_SUBDIRS = esub + override WFLAGS = -Wall + EXTRA_DIST = Makefile antimake.mk $(MAINTAINERCLEANFILES) # clean configured files diff --git a/mk/temos/src/libusual1.temo b/mk/temos/src/libusual1.temo index 41d9849..97c8944 100644 --- a/mk/temos/src/libusual1.temo +++ b/mk/temos/src/libusual1.temo @@ -21,9 +21,9 @@ usual_clone lib run cd lib runq ./autogen.sh -runq ./configure --disable-shared --prefix=`pwd`/../inst +runq ./configure --disable-shared --prefix=/opt runq make -runq make install +runq make install 'DESTDIR=`pwd`/../inst' run cd .. @@ -55,8 +55,8 @@ cat_file Makefile <<"EOF" OBJS = $(SRCS:.c=.o) # here we link to libusual - CPPFLAGS = -I./inst/include - LDFLAGS = -L./inst/lib + CPPFLAGS = -I./inst/opt/include + LDFLAGS = -L./inst/opt/lib LIBS = -lusual CC = gcc