Statistiques
| Révision :

root / pobysoC-4.0 / src / Makefile @ 133

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

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