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