Statistiques
| Révision :

root / pobysoC-4.0 / src / Makefile @ 143

Historique | Voir | Annoter | Télécharger (2,15 ko)

1
CC           = gcc
2
CFLAGS       = -Wall -g 
3
#CFLAGS       = -Wall -g -I /warehouse/storres/root/include
4
LDLIB        = -lmpfr -lgmp -lm -lfplll -lsollya
5

    
6
OBJS         = pobyso.o
7
INCS         = pobyso.h 
8
SOURCES      = $(INCS) pobyso.c
9

    
10
TEST_DRIVER  = # CUnit test driver binary program
11
TEST_DIR     = test
12
TEST_SOURCES = $(TEST_DIR)/$(TEST_DRIVER).c \
13
               # Add the suites definition sources
14

    
15
ALL_TARGETS = test-pobyso-01 test-pobyso-02 \
16
              test-pobyso-dirty-find-zeros  \
17
              test-pobyso-evaluate-constant \
18
              test-pobyso-is-constant-expression \
19
              test-pobyso-is-int \
20
              test-pobyso-is-monomial \
21
              test-pobyso-is-polynomial-term \
22
              test-pobyso-new-monomial \
23
              test-pobyso-subpoly
24

    
25
SCRATCH_PRG := $(patsubst %.c,%,$(wildcard *.c))
26
SCRATCH_ALL := $(SCRATCH_PRG)
27

    
28
LAST_ARCH_FILE = lastArch.txt
29

    
30
ARCH := $(shell uname -m)
31

    
32
DUMMY := $(shell touch $(LAST_ARCH_FILE))
33

    
34
LAST_ARCH := $(shell cat $(LAST_ARCH_FILE))
35

    
36
ifneq ($(LAST_ARCH), $(ARCH))
37
  DUMMY := $(shell echo $(ARCH) > $(LAST_ARCH_FILE))
38
  DUMMY := $(shell $(MAKE) clean) 
39
endif
40

    
41
ifeq (x86_64, $(ARCH))
42
  CFLAGS := -m64 $(CFLAGS)
43
  # LDLIB :=
44
endif
45

    
46
ifeq (ppc64, $(ARCH))
47
  CFLAGS := -m64 $(CFLAGS)
48
  # LDLIB :=
49
endif
50

    
51
ifeq (i686, $(ARCH))
52
  # CFLAGS := $(CFLAGS)
53
  # LDLIB :=
54
endif
55

    
56
# -------------------------------------------------------------------------
57

    
58
default: all
59
# Remove all implicit (suffix) rules. No need to remove pattern rules.
60
# Just redefine them.
61
.SUFFIXES:
62
# Keep the OBJS we want to link with user code.
63
.PRECIOUS: $(OBJS)
64

    
65
all: $(ALL_TARGETS)
66
test: $(TEST_DRIVER)
67

    
68
% : %.o $(OBJS)
69
	$(CC) $(CFLAGS) -o $@ $< $(OBJS) $(LDLIB)
70

    
71
%.o : %.c $(INCS)
72
	$(CC) $(CFLAGS) -c -o $@ $<
73

    
74
$(TEST_DRIVER) : 
75
	make -C test
76
	cp test/$(TEST_DRIVER) .
77
# -------------------------------------------------------------------------
78

    
79
.PHONY: clean scratch
80

    
81
clean:
82
	@rm -f $(ALL_TARGETS) $(TEST_DRIVER)
83
	@rm -f *.o a.out $(OBJS)
84
	@rm -f *~ *% #*#
85
	@make -C $(TEST_DIR) clean
86

    
87
scratch: clean
88
	rm -f $(SCRATCH_ALL)
89

    
90
# Change the documentation configuration and path accordingly.
91
documentation: pobyso.doxyconf $(SOURCES)
92
	doxygen pobyso.doxyconf