Statistiques
| Révision :

root / approxBasisSollya / Makefile @ 305

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

1 297 storres
CC           = gcc
2 297 storres
CFLAGS       = -Wall -g -I . -I pobyso
3 297 storres
LDLIB        = -lmpfr -lgmp -lm -lfplll -lsollya
4 297 storres
5 297 storres
OBJS         = approxbaso.o read-lines-from-file.o
6 297 storres
INCS         = approxbaso.h read-lines-from-file.h
7 297 storres
SOURCES      = $(INCS) approxbaso.c readlines-from-file.c
8 297 storres
9 297 storres
TEST_DIR     = test
10 297 storres
11 297 storres
ALL_TARGETS = $(OBJS)
12 297 storres
13 297 storres
SCRATCH_PRG := $(patsubst %.c,%,$(wildcard *.c))
14 297 storres
SCRATCH_ALL := $(SCRATCH_PRG)
15 297 storres
16 297 storres
LAST_ARCH_FILE = lastArch.txt
17 297 storres
18 297 storres
ARCH := $(shell uname -m)
19 297 storres
20 297 storres
DUMMY := $(shell touch $(LAST_ARCH_FILE))
21 297 storres
22 297 storres
LAST_ARCH := $(shell cat $(LAST_ARCH_FILE))
23 297 storres
24 297 storres
ifneq ($(LAST_ARCH), $(ARCH))
25 297 storres
  DUMMY := $(shell echo $(ARCH) > $(LAST_ARCH_FILE))
26 297 storres
  DUMMY := $(shell $(MAKE) clean)
27 297 storres
endif
28 297 storres
29 297 storres
ifeq (x86_64, $(ARCH))
30 297 storres
  CFLAGS := -m64 $(CFLAGS)
31 297 storres
  # LDLIB :=
32 297 storres
endif
33 297 storres
34 297 storres
ifeq (ppc64, $(ARCH))
35 297 storres
  CFLAGS := -m64 $(CFLAGS)
36 297 storres
  # LDLIB :=
37 297 storres
endif
38 297 storres
39 297 storres
ifeq (i686, $(ARCH))
40 297 storres
  # CFLAGS := $(CFLAGS)
41 297 storres
  # LDLIB :=
42 297 storres
endif
43 297 storres
44 297 storres
# -------------------------------------------------------------------------
45 297 storres
46 297 storres
default: all
47 297 storres
# Remove all implicit (suffix) rules. No need to remove pattern rules.
48 297 storres
# Just redefine them.
49 297 storres
.SUFFIXES:
50 297 storres
# Keep the OBJS we want to link with user code.
51 297 storres
.PRECIOUS: $(OBJS)
52 297 storres
53 297 storres
all: $(ALL_TARGETS)
54 297 storres
55 304 storres
test:
56 304 storres
	@$(MAKE) -C $(TEST_DIR) test
57 304 storres
58 297 storres
% : %.o $(OBJS)
59 297 storres
	$(CC) $(CFLAGS) -o $@ $< $(OBJS) $(LDLIB)
60 297 storres
61 297 storres
%.o : %.c $(INCS)
62 297 storres
	$(CC) $(CFLAGS) -c -o $@ $<
63 297 storres
64 297 storres
# -------------------------------------------------------------------------
65 297 storres
66 297 storres
.PHONY: clean scratch
67 297 storres
68 297 storres
clean:
69 304 storres
	@rm -f $(ALL_TARGETS)
70 297 storres
	@rm -f *.o a.out $(OBJS)
71 297 storres
	@rm -f *~ *% #*#
72 297 storres
	@make -C $(TEST_DIR) clean
73 297 storres
74 297 storres
scratch: clean
75 297 storres
	rm -f $(SCRATCH_ALL)
76 297 storres
77 297 storres
# Change the documentation configuration and path accordingly.
78 304 storres
documentation: approxbaso.doxyconf $(SOURCES)
79 297 storres
	doxygen approxbaso.doxyconf