-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathMakefile
More file actions
77 lines (57 loc) · 1.78 KB
/
Makefile
File metadata and controls
77 lines (57 loc) · 1.78 KB
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
# Makefile for Intel 8048 assembler
#
# Originally done by daveho in 2003
# Multiplatform extensions by sy2002/MEGA in 2013
#
# Compiles under Windows, Linux and OSX:
# Requires GNU make, http://www.gnu.org/software/make
# Requires GNU Compiler Collection http://www.gnu.org/software/gcc
# Requires FLEX and BISON
#
# Linux: Use your package manager to install FLEX and BISON before trying
# to compile.
#
# OSX only: Install XCode plus the optional command line tools (which already
# contain FLEX and BISON).
#
# Windows only: Recommended to compile using MSYS' Bournce Shell, since it already
# contains the GNU Compiler Collection as well as FLEX and BISON.
# Use the graphical installer and install MINGW together with MSYS as described here:
# http://www.mingw.org/wiki/Getting_Started
#if WINTEST != "" then Windows else unixoid (e.g. OSX, Linux, ...)
UNAME := $(shell uname -s)
WINDOWSID := CYGWIN MINGW UWIN
WINTEST = $(strip $(foreach win, $(WINDOWSID), $(findstring $(win), $(UNAME))))
ifneq ($(WINTEST), )
EXE = .exe
else
UNIXOID = -DUNIXOID
endif
# Choose debugging or optimization (or both)
#DEBUG = -g
OPT = -O
CC = gcc $(UNIXOID)
CFLAGS = $(DEBUG) $(OPT) -Wall $(EXTRA_CFLAGS)
BISON = bison
FLEX = flex
.SUFFIXES:
.SUFFIXES: .y .l .c .o
.y.o:
$(BISON) -d $*.y
$(CC) $(CFLAGS) -c $*.tab.c -o $*.o
.l.o:
$(FLEX) $*.l
$(CC) $(CFLAGS) -c $*.yy.c -o $*.o
.c.o:
$(CC) $(CFLAGS) -c $<
OBJS = parse.o lex.o asm48.o instruction.o expr.o symtab.o pool.o err.o ihex.o getopt.o
EXES = asm48$(EXE) 8039dasm$(EXE)
all : $(EXES)
asm48$(EXE) : $(OBJS)
$(CC) -o $@ $(OBJS)
8039dasm$(EXE) : 8039dasm.o
$(CC) -o $@ 8039dasm.o
lex.o : parse.o
expr.o : parse.o
clean :
rm asm48$(EXE) 8039dasm$(EXE) lex.yy.c *.o parse.tab.*