Statistiques
| Révision :

root / pobysoC-4.0 / src / Makefile @ 138

Historique | Voir | Annoter | Télécharger (2,06 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-is-constant-expression \
17
              test-pobyso-is-int \
18
              test-pobyso-is-monomial \
19
              test-pobyso-is-polynomial-term \
20
              test-pobyso-new-monomial \
21
              test-pobyso-subpoly
22

    
23
SCRATCH_PRG := $(patsubst %.c,%,$(wildcard *.c))
24
SCRATCH_ALL := $(SCRATCH_PRG)
25

    
26
LAST_ARCH_FILE = lastArch.txt
27

    
28
ARCH := $(shell uname -m)
29

    
30
DUMMY := $(shell touch $(LAST_ARCH_FILE))
31

    
32
LAST_ARCH := $(shell cat $(LAST_ARCH_FILE))
33

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

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

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

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

    
54
# -------------------------------------------------------------------------
55

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

    
63
all: $(ALL_TARGETS)
64
test: $(TEST_DRIVER)
65

    
66
% : %.o $(OBJS)
67
	$(CC) $(CFLAGS) -o $@ $< $(OBJS) $(LDLIB)
68

    
69
%.o : %.c $(INCS)
70
	$(CC) $(CFLAGS) -c -o $@ $<
71

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

    
77
.PHONY: clean scratch
78

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

    
85
scratch: clean
86
	rm -f $(SCRATCH_ALL)
87

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