Statistiques
| Révision :

root / pobysoC-4.0 / src / Makefile @ 134

Historique | Voir | Annoter | Télécharger (1,9 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-constant-expression \
17
              test-pobyso-new-monomial
18

    
19
SCRATCH_PRG := $(patsubst %.c,%,$(wildcard *.c))
20
SCRATCH_ALL := $(SCRATCH_PRG)
21

    
22
LAST_ARCH_FILE = lastArch.txt
23

    
24
ARCH := $(shell uname -m)
25

    
26
DUMMY := $(shell touch $(LAST_ARCH_FILE))
27

    
28
LAST_ARCH := $(shell cat $(LAST_ARCH_FILE))
29

    
30
ifneq ($(LAST_ARCH), $(ARCH))
31
  DUMMY := $(shell echo $(ARCH) > $(LAST_ARCH_FILE))
32
  DUMMY := $(shell $(MAKE) clean) 
33
endif
34

    
35
ifeq (x86_64, $(ARCH))
36
  CFLAGS := -m64 $(CFLAGS)
37
  # LDLIB :=
38
endif
39

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

    
45
ifeq (i686, $(ARCH))
46
  # CFLAGS := $(CFLAGS)
47
  # LDLIB :=
48
endif
49

    
50
# -------------------------------------------------------------------------
51

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

    
59
all: $(ALL_TARGETS)
60
test: $(TEST_DRIVER)
61

    
62
% : %.o $(OBJS)
63
	$(CC) $(CFLAGS) -o $@ $< $(OBJS) $(LDLIB)
64

    
65
%.o : %.c $(INCS)
66
	$(CC) $(CFLAGS) -c -o $@ $<
67

    
68
$(TEST_DRIVER) : 
69
	make -C test
70
	cp test/$(TEST_DRIVER) .
71
# -------------------------------------------------------------------------
72

    
73
.PHONY: clean scratch
74

    
75
clean:
76
	@rm -f $(ALL_TARGETS) $(TEST_DRIVER)
77
	@rm -f *.o a.out $(OBJS)
78
	@rm -f *~ *% #*#
79
	@make -C $(TEST_DIR) clean
80

    
81
scratch: clean
82
	rm -f $(SCRATCH_ALL)
83

    
84
# Change the documentation configuration and path accordingly.
85
documentation: pobyso.doxyconf $(SOURCES)
86
	doxygen pobyso.doxyconf