-
Notifications
You must be signed in to change notification settings - Fork 24
/
Copy pathGccWin.mak
76 lines (53 loc) · 1.42 KB
/
GccWin.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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
# This makefile creates the JWasm Win32 binary with either MinGW or Cygwin.
# 'mingw32-make -f GccWin.mak' will use MinGW (no MSys needed!).
# 'make -f GccWin.mak CYGWIN=1' will use Cygwin.
#
# As for MinGW: you don't need MSYS - just run mingw32-make.exe. However,
# the MinGW 'bin' subdirectory has to be in your path.
name = jwasm
ifndef CYGWIN
CYGWIN=0
endif
ifndef DEBUG
DEBUG=0
endif
inc_dirs = -Isrc/H
#cflags stuff
ifeq ($(DEBUG),1)
extra_c_flags = -DDEBUG_OUT -g
lflagsd=
ifeq ($(CYGWIN),1)
OUTD=build/CygwinD
else
OUTD=build/MinGWD
endif
else
extra_c_flags = -DNDEBUG -O2 -fomit-frame-pointer
lflagsd=-s
ifeq ($(CYGWIN),1)
OUTD=build/CygwinR
else
OUTD=build/MinGWR
endif
endif
c_flags = -D__NT__ $(extra_c_flags)
CC=gcc.exe -c $(inc_dirs) $(c_flags)
LINK=gcc.exe
$(OUTD)/%.o: src/%.c
$(CC) -o $(OUTD)/$*.o $<
include gccmod.inc
TARGET1=$(OUTD)/$(name).exe
ALL: $(OUTD) $(TARGET1)
$(OUTD):
mkdir $(OUTD)
$(OUTD)/$(name).exe : $(OUTD)/main.o $(proj_obj)
$(LINK) $(OUTD)/main.o $(proj_obj) $(lflagsd) -o $(OUTD)/$(name).exe -Wl,-Map,$(OUTD)/$(name).map
$(OUTD)/msgtext.o: src/msgtext.c src/H/msgdef.h
$(CC) -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) -o $(OUTD)/reswords.o src/reswords.c
######
clean:
@rm $(OUTD)/*.exe
@rm $(OUTD)/*.o
@rm $(OUTD)/*.map