summaryrefslogtreecommitdiff
path: root/devel/tavrasm/patches/patch-aa
blob: 41ef542cc9cc60ee626c2ebe7e14bfb0ef5a3da0 (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
--- src/makefile.orig	2004-12-11 23:51:29.000000000 +0000
+++ src/makefile	2020-12-24 11:41:02.928792258 +0000
@@ -24,40 +24,44 @@
 
 ### Compiler options #########################################################
 
-CC		= gcc
-CFLAGS          = -O2 -Wall -DAVRLANG=LANGUAGE_$(LANGUAGE)
-CPPFLAGS	=
+CFLAGS          += -DAVRLANG=LANGUAGE_$(LANGUAGE)
+CPPFLAGS	?=
 CCFLAGS         = $(CFLAGS) $(CPPFLAGS)
-LINK            = -lm -lstdc++
+LINK            = $(LDFLAGS) $(LIBS) -lm -lstdc++
 OBJS		= avrparse.o avrlex.o avrasm.o symbol.o semantic.o utils.o
+LEX		= lex
+YACC		= bison
 
 ### Defaul CC files #########################################################
 
 .cc.o:
-		$(CC) -c $(CCFLAGS) $<
+		$(CXX) -c $(CCFLAGS) $<
 
 ### Executable ##############################################################
 
+all:	$(EXENAME)
+
 $(EXENAME):	$(OBJS)
-		$(CC) $(CCFLAGS) $(OBJS) $(LINK) -o $@
+		$(CXX) $(CCFLAGS) $(OBJS) $(LINK) -o $@
 
 ### Parser file #############################################################
 
 avrparse.cc:	avrparse.y avrasm.hh symbol.hh semantic.hh opcodes.hh
-		bison -d -o avrparse avrparse.y
+		${YACC} -d -o avrparse avrparse.y
 		mv avrparse avrparse.cc
-		mv avrparse.h avrparse.hh
+		cp avrparse.h avrparse.hh
 
 ### Scanner file ############################################################
 
 avrlex.cc:	avrparse.cc avrlex.l symbol.hh semantic.hh avrparse.hh \
 		opcodes.hh avrasm.hh messages.hh
-		flex -o$@ avrlex.l
+		${LEX} -o$@ avrlex.l
 
 ### Dependencies ############################################################
 
-avrlex.o:	avrlex.l
-avrparse.o:	avrparse.y
+avrparse.hh:	avrparse.cc
+avrlex.o:	avrlex.cc
+avrparse.o:	avrparse.cc
 avrasm.o:	avrasm.cc avrasm.hh symbol.hh devices.hh messages.hh
 symbol.o:	symbol.cc symbol.hh avrasm.hh
 utils.o:	utils.cc utils.hh avrasm.hh messages.hh msg_us.hh msg_de.hh msg_sp.hh