Révision 304 approxBasisSollya/test/Makefile
Makefile (revision 304) | ||
---|---|---|
1 |
CC = gcc |
|
2 |
CFLAGS = -Wall -g |
|
3 |
LDLIB = #-Wl,--verbose |
|
1 |
# The Makefile only switches to lower level test Makefiles. |
|
4 | 2 |
|
5 |
OBJS = |
|
6 |
INCS = |
|
7 |
SOURCES = $(INCS) |
|
3 |
default: test |
|
8 | 4 |
|
9 |
TEST_DRIVER = # CUnit test driver binary program |
|
10 |
|
|
11 |
ALL_TARGETS = |
|
12 |
|
|
13 |
SCRATCH_PRG := $(patsubst %.c,%,$(wildcard *.c)) |
|
14 |
SCRATCH_ALL := $(SCRATCH_PRG) |
|
15 |
|
|
16 |
LAST_ARCH_FILE = lastArch.txt |
|
17 |
|
|
18 |
ARCH := $(shell uname -m) |
|
19 |
|
|
20 |
DUMMY := $(shell touch $(LAST_ARCH_FILE)) |
|
21 |
|
|
22 |
LAST_ARCH := $(shell cat $(LAST_ARCH_FILE)) |
|
23 |
|
|
24 |
ifneq ($(LAST_ARCH), $(ARCH)) |
|
25 |
DUMMY := $(shell echo $(ARCH) > $(LAST_ARCH_FILE)) |
|
26 |
DUMMY := $(shell $(MAKE) clean) |
|
27 |
endif |
|
28 |
|
|
29 |
ifeq (x86_64, $(ARCH)) |
|
30 |
CFLAGS := -m64 $(CFLAGS) |
|
31 |
# LDLIB := |
|
32 |
endif |
|
33 |
|
|
34 |
ifeq (ppc64, $(ARCH)) |
|
35 |
CFLAGS := -m64 $(CFLAGS) |
|
36 |
# LDLIB := |
|
37 |
endif |
|
38 |
|
|
39 |
ifeq (i686, $(ARCH)) |
|
40 |
# CFLAGS := $(CFLAGS) |
|
41 |
# LDLIB := |
|
42 |
endif |
|
43 |
|
|
44 |
# ------------------------------------------------------------------------- |
|
45 |
|
|
46 |
default: all |
|
47 |
# Remove all implicit (suffix) rules. No need to remove pattern rules. |
|
48 |
# Just redefine them. |
|
49 |
.SUFFIXES: |
|
50 |
# Keep the OBJS we want to link with user code. |
|
51 |
.PRECIOUS: $(OBJS) |
|
52 |
|
|
53 |
all: $(ALL_TARGETS) |
|
54 |
test: $(TEST_DRIVER) |
|
55 |
|
|
56 |
% : %.o $(OBJS) |
|
57 |
$(CC) $(CFLAGS) -o $@ $< $(OBJS) $(LDLIB) |
|
58 |
|
|
59 |
%.o : %.c $(INCS) |
|
60 |
$(CC) $(CFLAGS) -c -o $@ $< |
|
61 |
|
|
62 |
$(TEST_DRIVER) : |
|
63 |
make -C test |
|
64 |
cp test/$(TEST_DRIVER) . |
|
65 |
# ------------------------------------------------------------------------- |
|
66 |
|
|
67 |
.PHONY: clean scratch |
|
68 |
|
|
69 |
clean: |
|
70 |
@rm -f $(ALL_TARGETS) $(TEST_DRIVER) |
|
71 |
@rm -f *.o a.out $(OBJS) |
|
72 |
@rm -f *~ *% #*# |
|
73 |
|
|
74 |
|
|
5 |
test: |
|
6 |
@$(MAKE) -C test-approxbaso test |
|
7 |
@$(MAKE) -C test-read-lines test |
Formats disponibles : Unified diff