-
Notifications
You must be signed in to change notification settings - Fork 24
/
Copy pathCLUnix.mak
57 lines (39 loc) · 1.14 KB
/
CLUnix.mak
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
# This makefile creates the JWasm Win32 binary with CLang on Unix
# 'make CLUnix.mak'
name = jwasm
ifndef DEBUG
DEBUG=0
endif
inc_dirs = -Isrc/H
#cflags stuff
ifeq ($(DEBUG),1)
extra_c_flags = -DDEBUG_OUT -g
OUTD=build/CLUnixD
else
extra_c_flags = -DNDEBUG -O2
OUTD=build/CLUnixR
endif
TARGET1=$(OUTD)/$(name)
CC=clang
c_flags = -D__UNIX__ -Wno-parentheses -Wno-switch -Wno-enum-conversion $(extra_c_flags)
.SUFFIXES:
.SUFFIXES: .c .o
include gccmod.inc
$(OUTD)/%.o: src/%.c
$(CC) -c $(inc_dirs) $(c_flags) -o $(OUTD)/$*.o $<
ALL: $(OUTD) $(TARGET1)
$(OUTD):
mkdir -p $(OUTD)
$(OUTD)/$(name) : $(OUTD)/main.o $(proj_obj)
$(CC) $(OUTD)/main.o $(proj_obj) -o $@ -Wl,-Map,$(TARGET1).map
$(OUTD)/msgtext.o: src/msgtext.c src/H/msgdef.h
$(CC) -c $(inc_dirs) $(c_flags) -o $(OUTD)/msgtext.o src/msgtext.c
$(OUTD)/reswords.o: src/reswords.c src/H/instruct.h src/H/special.h src/H/directve.h
$(CC) -c $(inc_dirs) $(c_flags) -o $(OUTD)/reswords.o src/reswords.c
######
install:
@install $(OUTD)/$(name) /usr/local/bin
clean:
@rm -f $(OUTD)/$(name)
@rm -f $(OUTD)/*.o
@rm -f $(OUTD)/$(name).map