-
Notifications
You must be signed in to change notification settings - Fork 0
/
GccWin.mak
89 lines (68 loc) · 2.45 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
77
78
79
80
81
82
83
84
85
86
87
88
89
# 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.
name = jwasm
ifndef CYGWIN
CYGWIN=0
endif
ifndef DEBUG
DEBUG=0
endif
inc_dirs = -IH
#cflags stuff
ifeq ($(DEBUG),1)
extra_c_flags = -DDEBUG_OUT -g
ifeq ($(CYGWIN),1)
OUTD=CygwinD
else
OUTD=MinGWD
endif
else
extra_c_flags = -DNDEBUG -O2 -fomit-frame-pointer
ifeq ($(CYGWIN),1)
OUTD=CygwinR
else
OUTD=MinGWR
endif
endif
c_flags = -D__NT__ $(extra_c_flags)
CC=gcc.exe -c $(inc_dirs) $(c_flags)
$(OUTD)/%.obj: %.c
$(CC) -o $(OUTD)/$*.obj $<
proj_obj = $(OUTD)/main.obj $(OUTD)/assemble.obj $(OUTD)/assume.obj \
$(OUTD)/directiv.obj $(OUTD)/posndir.obj $(OUTD)/segment.obj \
$(OUTD)/expreval.obj $(OUTD)/memalloc.obj $(OUTD)/errmsg.obj \
$(OUTD)/macro.obj $(OUTD)/string.obj $(OUTD)/condasm.obj \
$(OUTD)/types.obj $(OUTD)/fpfixup.obj $(OUTD)/invoke.obj \
$(OUTD)/equate.obj $(OUTD)/mangle.obj $(OUTD)/loop.obj \
$(OUTD)/parser.obj $(OUTD)/tokenize.obj $(OUTD)/input.obj \
$(OUTD)/expans.obj $(OUTD)/symbols.obj $(OUTD)/labels.obj \
$(OUTD)/fixup.obj $(OUTD)/codegen.obj $(OUTD)/data.obj \
$(OUTD)/reswords.obj $(OUTD)/branch.obj $(OUTD)/queue.obj \
$(OUTD)/hll.obj $(OUTD)/proc.obj $(OUTD)/option.obj \
$(OUTD)/omf.obj $(OUTD)/omfint.obj $(OUTD)/omffixup.obj\
$(OUTD)/coff.obj $(OUTD)/elf.obj $(OUTD)/bin.obj \
$(OUTD)/listing.obj $(OUTD)/safeseh.obj \
$(OUTD)/context.obj $(OUTD)/extern.obj $(OUTD)/simsegm.obj \
$(OUTD)/backptch.obj $(OUTD)/msgtext.obj $(OUTD)/tbyte.obj \
$(OUTD)/dbgcv.obj $(OUTD)/end.obj $(OUTD)/cpumodel.obj\
$(OUTD)/cmdline.obj $(OUTD)/linnum.obj $(OUTD)/fastpass.obj
######
ifeq ($(CYGWIN),1)
proj_obj += $(OUTD)/apiemu.obj
endif
TARGET1=$(OUTD)/$(name).exe
ALL: $(OUTD) $(TARGET1)
$(OUTD):
mkdir $(OUTD)
$(OUTD)/$(name).exe : $(proj_obj)
gcc.exe $(proj_obj) -s -o $(OUTD)/$(name).exe -Wl,-Map,$(OUTD)/$(name).map
$(OUTD)/msgtext.obj: msgtext.c H/msgdef.h H/usage.h
$(CC) -o $(OUTD)/msgtext.obj msgtext.c
$(OUTD)/reswords.obj: reswords.c H/instruct.h H/special.h H/directve.h
$(CC) -o $(OUTD)/reswords.obj reswords.c
######
clean:
@rm $(OUTD)/*.exe
@rm $(OUTD)/*.obj
@rm $(OUTD)/*.map