summaryrefslogtreecommitdiff
blob: 997f39941a0731059b6ab9ed423781e923a93be0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
* Fix build system to honour CC, CFLAGS, CPPFLAGS and LDFLAGS
* Specify a default target, in order to keep the ebuild slim

--- a/Makefile
+++ b/Makefile
@@ -12,9 +12,9 @@
 
 # UNIX specific definitions (default)
 #
-CC= cc
-CFLAGS= -O -DANSI_C $(LXFLAGS)
-CLIB= -lm
+CC ?= cc
+CPPFLAGS += -DANSI_C $(LXFLAGS)
+LIBS += -lm
 
 # Windows 'nmake' specific definitions
 #
@@ -133,9 +133,6 @@
   $(objdir)writeSDF.o \
   $(objdir)writeSeq.o
 
-SRCS = $(OBJS:.o=.c)
-WOBJ = $(OBJS:.o=.obj)
-
 INCS = \
   $(incdir)chromatData.h \
   $(incdir)freeChromatData.h \
@@ -179,48 +176,18 @@
 # UNIX make specific phred target
 # note: a horizontal tab character must precede `$(CC)'
 #
-phred: $(OBJS)
-	$(CC) $(CFLAGS) -o phred $(OBJS) $(CLIB)
 
 
-# Windows nmake specific phred target
-#
-forwindows: $(WOBJ)
-	$(CC) $(CFLAGS) /Fephred $(WOBJ)
-#	$(CC) $(CFLAGS) /Fedaev daev.c
+.PHONY: all
+all: phred daev
 
 
-# test CC: refuse to compile if
-#
-#   o  SunOS
-#
-#   AND
-#
-#   o  using /usr/ucb/cc compiler
-#
-#   NOTE: this compiler causes problems: see PHRED.DOC
-#
-test_cc:
-	@if [ `uname` = SunOS ] ; \
-        then \
-          if [ `which $(CC)` = "/usr/ucb/cc" ] ; \
-          then \
-            echo ""; \
- echo "============================================================"; \
- echo "|                                                          |"; \
- echo "|   This SUN C compiler produces a bad phred executable.   |"; \
- echo "|                                                          |"; \
- echo "|   Please see the PHRED.DOC file for more information.    |"; \
- echo "|                                                          |"; \
- echo "============================================================"; \
-            echo ""; \
-             exit 1; \
-          fi \
-        fi
+phred: $(OBJS)
+	$(CC) $(LDFLAGS) $(CFLAGS) -o phred $^ $(LIBS)
 
 
 daev: daev.o
-	$(CC) $(CFLAGS) -o daev daev.o -lm
+	$(CC) $(LDFLAGS) $(CFLAGS) -o daev $^ $(LIBS)
 
 
 clean: