-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.inc
107 lines (91 loc) · 2.65 KB
/
Makefile.inc
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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
# vim: ft=make noexpandtab
ifeq ($(MAUG_ROOT),)
MAUG_ROOT := maug
endif
INCLUDES_GCC += -I$(MAUG_ROOT)/src
INCLUDES_WATCOM += -i=$(MAUG_ROOT)/src
INCLUDES_VS += /I $(MAUG_ROOT)/src
ifeq ("$(OPENGL)","1")
DEFINES_GCC += -DRETROFLAT_OPENGL
DEFINES_WATCOM += -DRETROFLAT_OPENGL
endif
GLOBAL_DEFINES += -DRETROFLAT_COMMIT_HASH="\"$(shell git -C $(MAUG_ROOT) rev-parse HEAD)\""
CFLAGS_GCC := $(GLOBAL_DEFINES) $(INCLUDES_GCC) $(DEFINES_GCC)
CFLAGS_GCC64 := $(GLOBAL_DEFINES) $(INCLUDES_GCC) $(DEFINES_GCC)
CFLAGS_WATCOM := $(GLOBAL_DEFINES) $(INCLUDES_WATCOM) $(DEFINES_WATCOM)
CFLAGS_WATCOM386 := $(GLOBAL_DEFINES) $(INCLUDES_WATCOM) $(DEFINES_WATCOM)
CFLAGS_EMCC := $(GLOBAL_DEFINES) $(DEFINES_GCC) $(INCLUDES_GCC)
LDFLAGS_GCC := $(LIBS_GCC)
LDFLAGS_GCC64 := $(LIBS_GCC)
LDFLAGS_WATCOM := $(LIBS_WATCOM)
LDFLAGS_WATCOM386 := $(LIBS_WATCOM)
CLEAN_TARGETS := obj *.err
#DEFINES_GLOBAL = -DLOG_TO_FILE -DLOG_FILE_NAME=\"out.log\"
ifeq ($(DEBUG_THRESHOLD),)
DEBUG_THRESHOLD := 1
endif
# Build debug unless release specified.
ifeq ("$(BUILD)","RELEASE")
CFLAGS_WATCOM += -ot
CFLAGS_WATCOM386 += -ot
CFLAGS_GCC += -O2
CFLAGS_GCC64 += -O2
CFLAGS_CECL += /O2 /D "NDEBUG" /W1 /ML
else
CFLAGS_WATCOM += -d3 -db -DDEBUG_LOG -DDEBUG -DDEBUG_THRESHOLD=$(DEBUG_THRESHOLD)
CFLAGS_WATCOM386 += -d3 -db -DDEBUG_LOG -DDEBUG -DDEBUG_THRESHOLD=$(DEBUG_THRESHOLD)
CFLAGS_GCC += -DDEBUG -Wall -g -pg -DMPARSER_TRACE_NAMES
CFLAGS_GCC64 += -DDEBUG -Wall -g -pg
LDFLAGS_GCC += -g -pg
LDFLAGS_GCC64 += -g -pg
CFLAGS_EMCC += -DDEBUG -DDEBUG_LOG -DDEBUG_THRESHOLD=$(DEBUG_THRESHOLD) -Wall
LDFLAGS_EMCC += --profiling-functions
LDFLAGS_WATCOM386 += debug all
CFLAGS_CECL += /W1 /MLd
endif
ifeq ("$(PEDANTIC)","1")
CFLAGS_GCC += -Wpedantic
CFLAGS_GCC64 += -Wpedantic
endif
ifeq ("$(WERROR)","1")
CFLAGS_GCC += -Werror -Wsign-compare
CFLAGS_GCC64 += -Werror -Wsign-compare
CFLAGS_WATCOM += -we
CFLAGS_WATCOM386 += -we
endif
ifeq ("$(C89)","1")
CFLAGS_GCC += -std=c89
CFLAGS_GCC64 += -std=c89
endif
# Default compiler specs.
ifeq ("$(CC_GCC)","")
CC_GCC := gcc
endif
ifeq ("$(CC_WATCOM)","")
CC_WATCOM := wcc
endif
ifeq ("$(LD_WATCOM)","")
LD_WATCOM := wlink
endif
ifeq ("$(CC_WATCOM386)","")
CC_WATCOM386 := wcc386
endif
ifeq ("$(LD_WATCOM386)","")
LD_WATCOM386 := wlink
endif
ifeq ("$(EMCC)","")
EMCC := emcc
endif
MD := mkdir -p
include maug/make/Makeico.inc
include maug/make/Maketpl.inc
include maug/make/Makevfs.inc
include maug/make/Makexpm.inc
include maug/make/Makeunix.inc
include maug/make/Makewin.inc
include maug/make/Makece.inc
include maug/make/Makewasm.inc
include maug/make/Makedos.inc
include maug/make/Makends.inc
include maug/make/Makeos2.inc
include maug/make/Makeplug.inc