Révision 297

approxBasisSollya/Makefile (revision 297)
1
CC           = gcc
2
CFLAGS       = -Wall -g -I . -I pobyso 
3
LDLIB        = -lmpfr -lgmp -lm -lfplll -lsollya
4

  
5
OBJS         = approxbaso.o read-lines-from-file.o
6
INCS         = approxbaso.h read-lines-from-file.h
7
SOURCES      = $(INCS) approxbaso.c readlines-from-file.c
8

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

  
14
ALL_TARGETS = $(OBJS)
15

  
16
SCRATCH_PRG := $(patsubst %.c,%,$(wildcard *.c))
17
SCRATCH_ALL := $(SCRATCH_PRG)
18

  
19
LAST_ARCH_FILE = lastArch.txt
20

  
21
ARCH := $(shell uname -m)
22

  
23
DUMMY := $(shell touch $(LAST_ARCH_FILE))
24

  
25
LAST_ARCH := $(shell cat $(LAST_ARCH_FILE))
26

  
27
ifneq ($(LAST_ARCH), $(ARCH))
28
  DUMMY := $(shell echo $(ARCH) > $(LAST_ARCH_FILE))
29
  DUMMY := $(shell $(MAKE) clean) 
30
endif
31

  
32
ifeq (x86_64, $(ARCH))
33
  CFLAGS := -m64 $(CFLAGS)
34
  # LDLIB :=
35
endif
36

  
37
ifeq (ppc64, $(ARCH))
38
  CFLAGS := -m64 $(CFLAGS)
39
  # LDLIB :=
40
endif
41

  
42
ifeq (i686, $(ARCH))
43
  # CFLAGS := $(CFLAGS)
44
  # LDLIB :=
45
endif
46

  
47
# -------------------------------------------------------------------------
48

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

  
56
all: $(ALL_TARGETS)
57
test: $(TEST_DRIVER)
58

  
59
% : %.o $(OBJS)
60
	$(CC) $(CFLAGS) -o $@ $< $(OBJS) $(LDLIB)
61

  
62
%.o : %.c $(INCS)
63
	$(CC) $(CFLAGS) -c -o $@ $<
64

  
65
$(TEST_DRIVER) : 
66
	make -C test
67
	cp test/$(TEST_DRIVER) .
68
# -------------------------------------------------------------------------
69

  
70
.PHONY: clean scratch
71

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

  
78
scratch: clean
79
	rm -f $(SCRATCH_ALL)
80

  
81
# Change the documentation configuration and path accordingly.
82
documentation: pobyso.doxyconf $(SOURCES)
83
	doxygen approxbaso.doxyconf
0 84

  

Formats disponibles : Unified diff