-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathMakefile
More file actions
45 lines (30 loc) · 936 Bytes
/
Makefile
File metadata and controls
45 lines (30 loc) · 936 Bytes
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
CC = gcc
CPPFLAGS = -D_POSIX_SOURCE -I.
CFLAGS = -Wall -Wextra -Wmissing-declarations -fPIC -std=c99 -pedantic -O3
LDFLAGS = -s -L.
YFLAGS = -d
PREFIX ?= /usr/local
EXE = as8051 pp8051 inst8051
TARGETS = $(EXE)
PRINTOBJ = print/lib8051print.o
LEXYACCOBJ = parser/yacc.8051.o parser/yacc.scan_8051.o parser/lex.8051.o parser/lex.scan_8051.o
PARSEROBJ = parser/parser8051.o
OBJFILES = $(PRINTOBJ) $(LEXYACCOBJ) $(PARSEROBJ) $(SRCFILES:.c=.o)
all: $(TARGETS)
as8051: LDLIBS += -lfl
as8051: $(PARSEROBJ) $(LEXYACCOBJ)
pp8051: LDLIBS += -lfl
pp8051: $(PARSEROBJ) $(LEXYACCOBJ) $(PRINTOBJ)
inst8051: LDLIBS += -lfl
inst8051: $(PARSEROBJ) $(LEXYACCOBJ)
install: $(TARGETS)
mkdir -p $(PREFIX)/bin
cp $(EXE) $(PREFIX)/bin
clean:
rm -f $(OBJFILES) $(TARGETS) y.tab.h
parser/lex.scan_8051.o: parser/lex.8051.c
%.hex: %.asm as8051
./as8051 $< >$@ || rm -f $@
%.bin: %.asm as8051
./as8051 -b $< >$@ || rm -f $@
.PHONY: all clean