-
Notifications
You must be signed in to change notification settings - Fork 49
/
Copy pathMakefile_Linux
60 lines (41 loc) · 1.16 KB
/
Makefile_Linux
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
# This makefile creates the UASM Elf binary for Linux/FreeBSD.
TARGET1=uasm
ifndef DEBUG
DEBUG=0
endif
inc_dirs = -IH
#cflags stuff
ifeq ($(DEBUG),0)
extra_c_flags = -DNDEBUG -O2 -ansi -funsigned-char -fwritable-strings
OUTD=GccUnixR
else
extra_c_flags = -DDEBUG_OUT -g
OUTD=GccUnixD
endif
c_flags =-D __UNIX__ $(extra_c_flags)
CC = clang-3.8
.SUFFIXES:
.SUFFIXES: .c .o
include gccmod.inc
#.c.o:
# $(CC) -c $(inc_dirs) $(c_flags) -o $(OUTD)/$*.o $<
$(OUTD)/%.o: %.c
$(CC) -D __UNIX__ -c $(inc_dirs) $(c_flags) -o $(OUTD)/$*.o $<
all: $(OUTD) $(OUTD)/$(TARGET1)
$(OUTD):
mkdir $(OUTD)
$(OUTD)/$(TARGET1) : $(OUTD)/main.o $(proj_obj)
ifeq ($(DEBUG),0)
$(CC) -D __UNIX__ $(OUTD)/main.o $(proj_obj) -s -o $@ -Wl,-Map,$(OUTD)/$(TARGET1).map
else
$(CC) -D __UNIX__ $(OUTD)/main.o $(proj_obj) -o $@ -Wl,-Map,$(OUTD)/$(TARGET1).map
endif
$(OUTD)/msgtext.o: msgtext.c H/msgdef.h
$(CC) -D __UNIX__ -c $(inc_dirs) $(c_flags) -o $*.o msgtext.c
$(OUTD)/reswords.o: reswords.c H/instruct.h H/special.h H/directve.h H/opndcls.h H/instravx.h
$(CC) -D __UNIX__ -c $(inc_dirs) $(c_flags) -o $*.o reswords.c
######
clean:
rm $(OUTD)/$(TARGET1)
rm $(OUTD)/*.o
rm $(OUTD)/*.map