Statistiques
| Révision :

root / approxBasisSollya / test / test-approxbaso / Makefile @ 303

Historique | Voir | Annoter | Télécharger (1,38 ko)

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