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