Test "PIP2" interface example.
[piplib.git] / example / Makefile
blobebc623150c4daa743f9f7ef8a6f0267e4d8fb9ec
1 # Please enter here the locations for PipLib include and libraries if they
2 # aren't the default values (/usr/lib and /usr/include).
3 PIPLIB_INC = $(HOME)/progs/linux/include
4 PIPLIB_LIB = $(HOME)/progs/linux/lib
6 CC = gcc
7 LDLIBS= -lpiplib32
8 CFLAGS= -DLINEAR_VALUE_IS_INT -I $(PIPLIB_INC) -L $(PIPLIB_LIB)
10 ROOT = ..
12 PIPTEST = \
13 big \
14 brisebarre \
15 cg1 \
16 esced \
17 ex \
18 ex2 \
19 fimmel \
20 max \
21 negative \
22 small \
23 sor1d \
24 square \
25 sven
27 BITS = 64
29 example: example.c
30 @echo " /*-----------------------------------------------*"
31 @echo " * Making example *"
32 @echo " *-----------------------------------------------*/"
33 $(CC) example.c -o example $(CFLAGS) $(LDLIBS)
35 pip:
36 $(MAKE) total -C ../
38 clean:
39 @echo " /*-----------------------------------------------*"
40 @echo " * Cleaning example *"
41 @echo " *-----------------------------------------------*/"
42 -rm -f example example.exe core
44 test:
45 failedtest=0; \
46 for x in $(PIPTEST) ; do \
47 echo "Verify file $$x" ; \
48 $(ROOT)/obj$(BITS)_$(TARGET)/example$(BITS)$(EXEC_SUFFIX) < $$x.pip > xyz ;\
49 diff -w xyz $$x.ll ; \
50 result=$$?; \
51 if [ "$$result" -eq "1" ]; then \
52 echo "Error: $$x is not the same"; \
53 failedtest=`expr $$failedtest + 1`; \
54 else \
55 echo "$$x passed"; \
56 fi; \
57 done ; \
58 rm xyz ; \
59 if [ $$failedtest != 0 ]; then \
60 echo "$$failedtest tests failed"; \
61 else \
62 echo "PIP works correctly :-)"; \
65 # Include the shared compilation rules
66 include $(ROOT)/Makefile