Statistiques
| Révision :

root / pobysoC-4.0 / src / Makefile @ 149

Historique | Voir | Annoter | Télécharger (2,15 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 143 storres
              test-pobyso-dirty-find-zeros  \
17 143 storres
              test-pobyso-evaluate-constant \
18 138 storres
              test-pobyso-is-constant-expression \
19 137 storres
              test-pobyso-is-int \
20 138 storres
              test-pobyso-is-monomial \
21 138 storres
              test-pobyso-is-polynomial-term \
22 136 storres
              test-pobyso-new-monomial \
23 136 storres
              test-pobyso-subpoly
24 26 storres
25 26 storres
SCRATCH_PRG := $(patsubst %.c,%,$(wildcard *.c))
26 26 storres
SCRATCH_ALL := $(SCRATCH_PRG)
27 26 storres
28 26 storres
LAST_ARCH_FILE = lastArch.txt
29 26 storres
30 26 storres
ARCH := $(shell uname -m)
31 26 storres
32 26 storres
DUMMY := $(shell touch $(LAST_ARCH_FILE))
33 26 storres
34 26 storres
LAST_ARCH := $(shell cat $(LAST_ARCH_FILE))
35 26 storres
36 26 storres
ifneq ($(LAST_ARCH), $(ARCH))
37 26 storres
  DUMMY := $(shell echo $(ARCH) > $(LAST_ARCH_FILE))
38 26 storres
  DUMMY := $(shell $(MAKE) clean)
39 26 storres
endif
40 26 storres
41 26 storres
ifeq (x86_64, $(ARCH))
42 26 storres
  CFLAGS := -m64 $(CFLAGS)
43 26 storres
  # LDLIB :=
44 26 storres
endif
45 26 storres
46 26 storres
ifeq (ppc64, $(ARCH))
47 26 storres
  CFLAGS := -m64 $(CFLAGS)
48 26 storres
  # LDLIB :=
49 26 storres
endif
50 26 storres
51 26 storres
ifeq (i686, $(ARCH))
52 26 storres
  # CFLAGS := $(CFLAGS)
53 26 storres
  # LDLIB :=
54 26 storres
endif
55 26 storres
56 26 storres
# -------------------------------------------------------------------------
57 26 storres
58 26 storres
default: all
59 26 storres
# Remove all implicit (suffix) rules. No need to remove pattern rules.
60 26 storres
# Just redefine them.
61 26 storres
.SUFFIXES:
62 26 storres
# Keep the OBJS we want to link with user code.
63 26 storres
.PRECIOUS: $(OBJS)
64 26 storres
65 26 storres
all: $(ALL_TARGETS)
66 26 storres
test: $(TEST_DRIVER)
67 26 storres
68 26 storres
% : %.o $(OBJS)
69 26 storres
	$(CC) $(CFLAGS) -o $@ $< $(OBJS) $(LDLIB)
70 26 storres
71 26 storres
%.o : %.c $(INCS)
72 26 storres
	$(CC) $(CFLAGS) -c -o $@ $<
73 26 storres
74 26 storres
$(TEST_DRIVER) :
75 26 storres
	make -C test
76 26 storres
	cp test/$(TEST_DRIVER) .
77 26 storres
# -------------------------------------------------------------------------
78 26 storres
79 26 storres
.PHONY: clean scratch
80 26 storres
81 26 storres
clean:
82 26 storres
	@rm -f $(ALL_TARGETS) $(TEST_DRIVER)
83 26 storres
	@rm -f *.o a.out $(OBJS)
84 26 storres
	@rm -f *~ *% #*#
85 26 storres
	@make -C $(TEST_DIR) clean
86 26 storres
87 26 storres
scratch: clean
88 26 storres
	rm -f $(SCRATCH_ALL)
89 26 storres
90 26 storres
# Change the documentation configuration and path accordingly.
91 26 storres
documentation: pobyso.doxyconf $(SOURCES)
92 26 storres
	doxygen pobyso.doxyconf