summaryrefslogtreecommitdiff
path: root/devel/tavrasm/patches/patch-aa
blob: 811e5a36494f79f9d681c7f1ea34ecd48be64e5b (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
$NetBSD: patch-aa,v 1.4 2006/10/01 21:03:36 dillo Exp $

--- src/makefile.orig	2003-03-12 01:56:02.000000000 +0100
+++ src/makefile
@@ -24,12 +24,14 @@ VERSION		= 117
 
 ### Compiler options #########################################################
 
-CC		= gcc
-CFLAGS          = -O2 -Wall -DAVRLANG=LANGUAGE_$(LANGUAGE)
-CPPFLAGS	=
+CC		?= gcc
+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 #########################################################
 
@@ -38,13 +40,15 @@ OBJS		= avrparse.o avrlex.o avrasm.o sym
 
 ### Executable ##############################################################
 
+all:	$(EXENAME)
+
 $(EXENAME):	$(OBJS)
 		$(CC) $(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
 
@@ -52,12 +56,12 @@ avrparse.cc:	avrparse.y avrasm.hh symbol
 
 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
+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