aboutsummaryrefslogtreecommitdiffstats
path: root/math/aamath/files/patch-Makefile
blob: 1557574f9a77df053914b05ddf3d6e7719c82add (plain) (blame)
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
--- Makefile.orig
+++ Makefile
@@ -1,17 +1,22 @@
-CXX        = g++
-LD     = g++
+CXX        ?= g++
+LD     = $(CXX)
 CXXFILES   = parser.cc lexer.cc expr.cc canvas.cc aamath.cc
 OBJS       = $(CXXFILES:.cc=.o) 
 TARGET     = aamath
-CFLAGS     = -Wall -O2 -g -DUSE_READLINE
-LFLAGS     = -g
+CFLAGS     += -Wall -DUSE_READLINE
 LIBS       = -lreadline -ltermcap
 
 $(TARGET): $(OBJS)
    $(LD) $(LFLAGS) $(OBJS) -o $@ $(LIBS)
 
-parser.cc parser.h: parser.y
-   yacc -d parser.y && mv y.tab.c parser.cc && mv y.tab.h parser.h
+yacc: parser.y
+   yacc -d parser.y
+
+parser.cc: yacc
+   mv y.tab.c parser.cc
+
+parser.h: yacc
+   mv y.tab.h parser.h
 
 lexer.cc: lexer.l parser.h
    lex lexer.l && mv lex.yy.c lexer.cc
@@ -21,3 +26,5 @@
 
 clean:
    rm -f *.o lexer.cc parser.h parser.cc $(TARGET)
+
+all: $(TARGET)