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