-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
55 lines (43 loc) · 1.27 KB
/
Makefile
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
prefix = $(DESTDIR)/usr/local
bindir = $(prefix)/bin
mandir = $(prefix)/share/man
datadir = $(prefix)/share/asm51
CC = gcc
NAME = asm51
VERSION = 0.6
OBJS = main.o parser.o lexer.o xmalloc.o output.o symbols.o
CFLAGS = -Wall -O2 -ggdb -DDATADIR=\"$(datadir)\"
BISON = bison
FLEX = flex
INSTALL = install
STRIP = strip
FILES = Makefile lexer.l main.[ch] parser.y output.[ch] symbols.[ch] xmalloc.[ch] asm51.1 asm51.pl.1 README mod51
all: $(NAME)
$(NAME): $(OBJS)
$(CC) $(OBJS) -o $(NAME)
parser.c: parser.y
$(BISON) -d parser.y -o parser.c
lexer.c: lexer.l
$(FLEX) -i -olexer.c lexer.l
.PHONY: install clean checkin strip dist
strip: $(NAME)
$(STRIP) $(NAME) || true
install: $(NAME)
$(INSTALL) -d $(bindir)
$(INSTALL) $(NAME) $(bindir)
$(INSTALL) -d $(mandir)/man1
$(INSTALL) -d $(mandir)/pl/man1
$(INSTALL) -m 0644 asm51.1 $(mandir)/man1
$(INSTALL) -m 0644 asm51.pl.1 $(mandir)/pl/man1/asm51.1
$(INSTALL) -d $(datadir)
$(INSTALL) -m 0644 mod51 $(datadir)
clean:
rm -f *.o *.wo core $(NAME) lexer.c parser.[ch]
checkin: clean
ci -l -m. $(FILES)
dist: clean
mkdir -p /tmp/asm51-$(VERSION)/doc
cp $(FILES) /tmp/asm51-$(VERSION)
cp doc/asm51.sxw /tmp/asm51-$(VERSION)/doc
cd /tmp; tar zcvf $(PWD)/asm51-$(VERSION).tar.gz asm51-$(VERSION)
# rm -rf /tmp/asm51-$(VERSION)