root / pobysoC-4.0 / src / Makefile @ 137
Historique | Voir | Annoter | Télécharger (1,97 ko)
1 | 26 | storres | CC = gcc |
---|---|---|---|
2 | 126 | storres | CFLAGS = -Wall -g |
3 | 126 | storres | #CFLAGS = -Wall -g -I /warehouse/storres/root/include |
4 | 132 | storres | LDLIB = -lmpfr -lgmp -lm -lfplll -lsollya |
5 | 26 | storres | |
6 | 26 | storres | OBJS = pobyso.o |
7 | 26 | storres | INCS = pobyso.h |
8 | 26 | storres | SOURCES = $(INCS) pobyso.c |
9 | 26 | storres | |
10 | 26 | storres | TEST_DRIVER = # CUnit test driver binary program |
11 | 26 | storres | TEST_DIR = test |
12 | 26 | storres | TEST_SOURCES = $(TEST_DIR)/$(TEST_DRIVER).c \ |
13 | 26 | storres | # Add the suites definition sources |
14 | 26 | storres | |
15 | 133 | storres | ALL_TARGETS = test-pobyso-01 test-pobyso-02 \ |
16 | 134 | storres | test-pobyso-constant-expression \ |
17 | 137 | storres | test-pobyso-is-int \ |
18 | 136 | storres | test-pobyso-new-monomial \ |
19 | 136 | storres | test-pobyso-subpoly |
20 | 26 | storres | |
21 | 26 | storres | SCRATCH_PRG := $(patsubst %.c,%,$(wildcard *.c)) |
22 | 26 | storres | SCRATCH_ALL := $(SCRATCH_PRG) |
23 | 26 | storres | |
24 | 26 | storres | LAST_ARCH_FILE = lastArch.txt |
25 | 26 | storres | |
26 | 26 | storres | ARCH := $(shell uname -m) |
27 | 26 | storres | |
28 | 26 | storres | DUMMY := $(shell touch $(LAST_ARCH_FILE)) |
29 | 26 | storres | |
30 | 26 | storres | LAST_ARCH := $(shell cat $(LAST_ARCH_FILE)) |
31 | 26 | storres | |
32 | 26 | storres | ifneq ($(LAST_ARCH), $(ARCH)) |
33 | 26 | storres | DUMMY := $(shell echo $(ARCH) > $(LAST_ARCH_FILE)) |
34 | 26 | storres | DUMMY := $(shell $(MAKE) clean) |
35 | 26 | storres | endif |
36 | 26 | storres | |
37 | 26 | storres | ifeq (x86_64, $(ARCH)) |
38 | 26 | storres | CFLAGS := -m64 $(CFLAGS) |
39 | 26 | storres | # LDLIB := |
40 | 26 | storres | endif |
41 | 26 | storres | |
42 | 26 | storres | ifeq (ppc64, $(ARCH)) |
43 | 26 | storres | CFLAGS := -m64 $(CFLAGS) |
44 | 26 | storres | # LDLIB := |
45 | 26 | storres | endif |
46 | 26 | storres | |
47 | 26 | storres | ifeq (i686, $(ARCH)) |
48 | 26 | storres | # CFLAGS := $(CFLAGS) |
49 | 26 | storres | # LDLIB := |
50 | 26 | storres | endif |
51 | 26 | storres | |
52 | 26 | storres | # ------------------------------------------------------------------------- |
53 | 26 | storres | |
54 | 26 | storres | default: all |
55 | 26 | storres | # Remove all implicit (suffix) rules. No need to remove pattern rules. |
56 | 26 | storres | # Just redefine them. |
57 | 26 | storres | .SUFFIXES: |
58 | 26 | storres | # Keep the OBJS we want to link with user code. |
59 | 26 | storres | .PRECIOUS: $(OBJS) |
60 | 26 | storres | |
61 | 26 | storres | all: $(ALL_TARGETS) |
62 | 26 | storres | test: $(TEST_DRIVER) |
63 | 26 | storres | |
64 | 26 | storres | % : %.o $(OBJS) |
65 | 26 | storres | $(CC) $(CFLAGS) -o $@ $< $(OBJS) $(LDLIB) |
66 | 26 | storres | |
67 | 26 | storres | %.o : %.c $(INCS) |
68 | 26 | storres | $(CC) $(CFLAGS) -c -o $@ $< |
69 | 26 | storres | |
70 | 26 | storres | $(TEST_DRIVER) : |
71 | 26 | storres | make -C test |
72 | 26 | storres | cp test/$(TEST_DRIVER) . |
73 | 26 | storres | # ------------------------------------------------------------------------- |
74 | 26 | storres | |
75 | 26 | storres | .PHONY: clean scratch |
76 | 26 | storres | |
77 | 26 | storres | clean: |
78 | 26 | storres | @rm -f $(ALL_TARGETS) $(TEST_DRIVER) |
79 | 26 | storres | @rm -f *.o a.out $(OBJS) |
80 | 26 | storres | @rm -f *~ *% #*# |
81 | 26 | storres | @make -C $(TEST_DIR) clean |
82 | 26 | storres | |
83 | 26 | storres | scratch: clean |
84 | 26 | storres | rm -f $(SCRATCH_ALL) |
85 | 26 | storres | |
86 | 26 | storres | # Change the documentation configuration and path accordingly. |
87 | 26 | storres | documentation: pobyso.doxyconf $(SOURCES) |
88 | 26 | storres | doxygen pobyso.doxyconf |