root / pobysoC-4.0 / src / Makefile @ 136
Historique | Voir | Annoter | Télécharger (1,94 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-new-monomial \ |
18 |
test-pobyso-subpoly |
19 |
|
20 |
SCRATCH_PRG := $(patsubst %.c,%,$(wildcard *.c)) |
21 |
SCRATCH_ALL := $(SCRATCH_PRG) |
22 |
|
23 |
LAST_ARCH_FILE = lastArch.txt |
24 |
|
25 |
ARCH := $(shell uname -m) |
26 |
|
27 |
DUMMY := $(shell touch $(LAST_ARCH_FILE)) |
28 |
|
29 |
LAST_ARCH := $(shell cat $(LAST_ARCH_FILE)) |
30 |
|
31 |
ifneq ($(LAST_ARCH), $(ARCH)) |
32 |
DUMMY := $(shell echo $(ARCH) > $(LAST_ARCH_FILE)) |
33 |
DUMMY := $(shell $(MAKE) clean) |
34 |
endif |
35 |
|
36 |
ifeq (x86_64, $(ARCH)) |
37 |
CFLAGS := -m64 $(CFLAGS) |
38 |
# LDLIB := |
39 |
endif |
40 |
|
41 |
ifeq (ppc64, $(ARCH)) |
42 |
CFLAGS := -m64 $(CFLAGS) |
43 |
# LDLIB := |
44 |
endif |
45 |
|
46 |
ifeq (i686, $(ARCH)) |
47 |
# CFLAGS := $(CFLAGS) |
48 |
# LDLIB := |
49 |
endif |
50 |
|
51 |
# ------------------------------------------------------------------------- |
52 |
|
53 |
default: all |
54 |
# Remove all implicit (suffix) rules. No need to remove pattern rules. |
55 |
# Just redefine them. |
56 |
.SUFFIXES: |
57 |
# Keep the OBJS we want to link with user code. |
58 |
.PRECIOUS: $(OBJS) |
59 |
|
60 |
all: $(ALL_TARGETS) |
61 |
test: $(TEST_DRIVER) |
62 |
|
63 |
% : %.o $(OBJS) |
64 |
$(CC) $(CFLAGS) -o $@ $< $(OBJS) $(LDLIB) |
65 |
|
66 |
%.o : %.c $(INCS) |
67 |
$(CC) $(CFLAGS) -c -o $@ $< |
68 |
|
69 |
$(TEST_DRIVER) : |
70 |
make -C test |
71 |
cp test/$(TEST_DRIVER) . |
72 |
# ------------------------------------------------------------------------- |
73 |
|
74 |
.PHONY: clean scratch |
75 |
|
76 |
clean: |
77 |
@rm -f $(ALL_TARGETS) $(TEST_DRIVER) |
78 |
@rm -f *.o a.out $(OBJS) |
79 |
@rm -f *~ *% #*# |
80 |
@make -C $(TEST_DIR) clean |
81 |
|
82 |
scratch: clean |
83 |
rm -f $(SCRATCH_ALL) |
84 |
|
85 |
# Change the documentation configuration and path accordingly. |
86 |
documentation: pobyso.doxyconf $(SOURCES) |
87 |
doxygen pobyso.doxyconf |