root/openpgpsdk/trunk/tests/Makefile.template

Revision 468 (checked in by rachel, 6 years ago)

Automated build of CUnit before compiling tests

Line 
1 DM_FLAGS=%DM_FLAGS%
2 DM_LIB=%DM_LIB%
3 CC=%CC%
4
5 CUNIT_LIB=../lib/libcunit.a
6 CUNIT_INC=../include/CUnit
7
8
9 CFLAGS=-Wall -Werror -g $(DM_FLAGS) -I../include %INCLUDES% %CFLAGS%
10 LDFLAGS=-g %CFLAGS%
11 LIBDEPS=../src/standard/libops_std.a ../src/advanced/libops_adv.a
12 LIBS=$(LIBDEPS) %CRYPTO_LIBS% %ZLIB% $(DM_LIB) $(CUNIT_LIB)
13
14 TESTSRC=tests.c test_rsa_decrypt.c test_rsa_encrypt.c
15 TESTOBJ=$(TESTSRC:.c=.o)
16
17 all: Makefile $(CUNIT_LIB) .depend tests
18
19 tests: $(CUNIT_LIB) $(TESTOBJ) $(LIBDEPS)
20         $(CC) $(LDFLAGS) -o tests $(TESTOBJ) $(LIBS)
21         make runtests
22
23 runtests:
24         ./tests
25
26 $(CUNIT_LIB):
27         tar xvfz CUnit-2.1-0-src.tar.gz
28         (cd CUnit-2.1-0; ./configure --prefix $(PWD)/../; make; make install)
29
30 clean:
31         rm -f $(EXES) *.o *.i
32         rm -rf testdir.*
33         rm -f TAGS
34
35 .depend: *.[ch] ../include/openpgpsdk/*.h $(CUNIT_INC)
36
37         $(CC) $(CFLAGS) -E -M *.c > .depend
38
39 force_depend:
40         $(CC) $(CFLAGS) -E -M *.c > .depend
41
42 Makefile: Makefile.template ../configure
43         echo Makefile is older than templates, rerun configure
44         exit 1
45
Note: See TracBrowser for help on using the browser.