-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
64 lines (50 loc) · 914 Bytes
/
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
55
56
57
58
59
60
61
62
63
64
CC=gcc
CFLAGS= -Wall -O2 -fomit-frame-pointer
LDFLAGS=
all: lyxass
ifeq ($(OSTYPE),cygwin)
EXT=.exe
else
EXT=#
endif
ifeq ($(OSTYPE),)
OSTYPE:=linux
endif
.dep:
$(CC) -MM *.c >.dep
.c.o :
$(CC) -MD -c $(CFLAGS) $(INC) $< -o $@
@if [ ! -e $*.d ] ; then mv `basename $*.d` $*.d; fi
@cp $*.d $*.P;\
sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//'\
-e '/^$$/ d' -e 's/$$/ :/' < $*.d >>$*.P
@rm $*.d
#.c.o:
# $(CC) $(CFLAGS) -c $<
SRC = lyxass.c
SRC += parser.c
SRC += debug.c
SRC += label.c
SRC += opcode.c
SRC += pseudo.c
SRC += mnemonics.c
SRC += expression.c
SRC += macro.c
SRC += ref.c
SRC += error.c
SRC += jaguar.c
OBJ = $(SRC:.c=.o)
-include $(SRC:.c=.P)
lyxass: $(OBJ)
$(CC) $(LDFLAGS) $(OBJ) -o $@
.PHONY: install
install: lyxass
cp lyxass bin/$(OSTYPE)
upx --lzma bin/$(OSTYPE)/lyxass$(EXT)
clean:
rm -f .dep
rm -f *.o
rm -f lyxass
rm -f lyxass.exe
rm -f *~
rm -f *.P