-
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathmakefile
More file actions
254 lines (200 loc) · 5.51 KB
/
Copy pathmakefile
File metadata and controls
254 lines (200 loc) · 5.51 KB
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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
###########################################################################
.PHONY: all clean install strip
###########################################################################
# Flags used for compiling
CFLAGS += -I.
CFLAGS += -IResourcer
CFLAGS += -Wextra
CFLAGS += -Wall
CFLAGS += -MMD
CFLAGS += -MP
CFLAGS += -O2
CFLAGS += -W
#CFLAGS += -g
#CFLAGS += -DDEBUG
# Flags passed to gcc during linking
LDFLAGS :=
# Additional linker libraries
LIBS :=
# Source Dirs
SRCDIRS := Resourcer
SRCDIRS += Resourcer/33_Trace
SRCDIRS += Resourcer/44_Label
SRCDIRS += Resourcer/55_Build
SRCDIRS += Resourcer/66_Save
SRCDIRS += Resourcer/_Brance
SRCDIRS += Resourcer/_Config
SRCDIRS += Resourcer/_Label
SRCDIRS += Resourcer/_Misc
SRCDIRS += Resourcer/_Node
SRCDIRS += Resourcer/_Ref
SRCDIRS += Resourcer/_Section
SRCDIRS += Resourcer/_Source
# Object Dir
OBJDIR := obj
# Binary Dir
BINDIR := bin
###########################################################################
# Loaders
LOADER_FHR := 1
LOADER_HUNK := 1
# Systems
SYSTEM_AMIGAOS3 := 1
# CPUs
CPU_M68K := 1
###########################################################################
ifeq ($(LOADER_FHR),1)
CFLAGS += -DSUPPORT_FHR
SRCDIRS += Loader_FHR
endif
ifeq ($(LOADER_HUNK),1)
CFLAGS += -DSUPPORT_HUNK
SRCDIRS += Loader_Hunk
endif
ifeq ($(SYSTEM_AMIGAOS3),1)
CFLAGS += -DSUPPORT_AMIGAOS3
SRCDIRS += System_AmigaOS3
SRCDIRS += System_AmigaOS3/Lib_Amigaguide
SRCDIRS += System_AmigaOS3/Lib_Asl
SRCDIRS += System_AmigaOS3/Lib_Bullet
SRCDIRS += System_AmigaOS3/Lib_Colorwheel
SRCDIRS += System_AmigaOS3/Lib_Commodities
SRCDIRS += System_AmigaOS3/Lib_Console
SRCDIRS += System_AmigaOS3/Lib_Datatypes
SRCDIRS += System_AmigaOS3/Lib_Diskfont
SRCDIRS += System_AmigaOS3/Lib_Dos
SRCDIRS += System_AmigaOS3/Lib_DTClass
SRCDIRS += System_AmigaOS3/Lib_Exec
SRCDIRS += System_AmigaOS3/Lib_Expansion
SRCDIRS += System_AmigaOS3/Lib_Gadtools
SRCDIRS += System_AmigaOS3/Lib_Graphics
SRCDIRS += System_AmigaOS3/Lib_Icon
SRCDIRS += System_AmigaOS3/Lib_IFFParse
SRCDIRS += System_AmigaOS3/Lib_Input
SRCDIRS += System_AmigaOS3/Lib_Intuition
SRCDIRS += System_AmigaOS3/Lib_Keymap
SRCDIRS += System_AmigaOS3/Lib_Layers
SRCDIRS += System_AmigaOS3/Lib_Locale
SRCDIRS += System_AmigaOS3/Lib_Lowlevel
SRCDIRS += System_AmigaOS3/Lib_Mathffp
SRCDIRS += System_AmigaOS3/Lib_Mathieeedoubbas
SRCDIRS += System_AmigaOS3/Lib_Mathieeedoubtrans
SRCDIRS += System_AmigaOS3/Lib_Mathieeesingbas
SRCDIRS += System_AmigaOS3/Lib_Mathieeesingtrans
SRCDIRS += System_AmigaOS3/Lib_Mathtrans
SRCDIRS += System_AmigaOS3/Lib_Nonvolatile
SRCDIRS += System_AmigaOS3/Lib_Rexxapp
SRCDIRS += System_AmigaOS3/Lib_Rexxsyslib
SRCDIRS += System_AmigaOS3/Lib_Translator
SRCDIRS += System_AmigaOS3/Lib_Utility
SRCDIRS += System_AmigaOS3/Lib_Workbench
SRCDIRS += System_AmigaOS3/Res_Battclock
SRCDIRS += System_AmigaOS3/Res_Battmem
SRCDIRS += System_AmigaOS3/Res_Cardres
SRCDIRS += System_AmigaOS3/Res_Cia
SRCDIRS += System_AmigaOS3/Res_Disk
SRCDIRS += System_AmigaOS3/Res_Misc
SRCDIRS += System_AmigaOS3/Res_Potgo
endif
ifeq ($(CPU_M68K),1)
CFLAGS += -DSUPPORT_M68K
SRCDIRS += CPU_M68k
SRCDIRS += CPU_M68k/_CPU
SRCDIRS += CPU_M68k/_FPU
SRCDIRS += CPU_M68k/_MMU
endif
###########################################################################
ifeq ($(OS),Windows_NT)
detected_os := Windows
else
detected_os := $(shell uname)
endif
# --
ifeq ($(detected_os),Windows)
AR := ar
RM := del
CC := gcc
STRIP := strip
MKDIR := mkdir
COPY := copy
SDK :=
CRT :=
TARGET := ReSrc4.exe
# --
else ifeq ($(detected_os),AmigaOS)
# Native AmigaOS4 Build
LS := list
AR := ar
RM := delete
CC := gcc
STRIP := strip
MKDIR := mkdir -p
COPY := copy CLONE
SDK := sdk:
CRT := newlib
TARGET := ReSrc4
CFLAGS += -DBIGENDIAN
INSTALLCMD := copy clone $(BINDIR)/$(TARGET) c:
CFLAGS += -mcrt=$(CRT)
LDFLAGS += -mcrt=$(CRT)
# --
else # ifeq ($(detected_os),Linux)
CrossCompile := 0
ifeq ($(CrossCompile),1)
# Cross Compile for AmigaOS4
LS := ls -lort
AR := ppc-amigaos-ar
RM := rm
CC := ppc-amigaos-gcc
STRIP := ppc-amigaos-strip
MKDIR := mkdir -p
COPY := cp
SDK := /SDK/
CRT := newlib
TARGET := ReSrc4
INSTALLCMD :=
CFLAGS += -mcrt=$(CRT)
LDFLAGS += -mcrt=$(CRT)
else
# Native Linux Build
LS := ls -lort
AR := ar
RM := rm
CC := clang
STRIP := strip
MKDIR := mkdir -p
COPY := cp
SDK :=
CRT :=
TARGET := ReSrc4
INSTALLCMD := install -m 755 $(BINDIR)/$(TARGET) ~/bin
endif
endif
# --
###############################################################################
SRCS += $(wildcard $(addsuffix /*.c, $(SRCDIRS)))
OBJS := $(patsubst %.c,$(OBJDIR)/%.o,$(SRCS))
DEPS := $(patsubst %.c,$(OBJDIR)/%.d,$(SRCS))
###########################################################################
all: $(BINDIR)/$(TARGET)
-include $(DEPS)
###########################################################################
$(BINDIR)/$(TARGET): $(OBJS) | $(BINDIR)
$(CC) $(LDFLAGS) -o $(BINDIR)/$(TARGET) $(OBJS) $(LIBS) -Wl,--cref,-M,-Map=$(TARGET).map
$(BINDIR):
$(MKDIR) $(BINDIR)
###########################################################################
clean:
$(RM) $(OBJS) $(DEPS) $(BINDIR)/$(TARGET)
strip:
@$(LS) $(BINDIR)/$(TARGET)
@$(STRIP) $(BINDIR)/$(TARGET)
@$(LS) $(BINDIR)/$(TARGET)
install:
$(INSTALLCMD)
@echo "Done"
###########################################################################
$(OBJDIR)/%.o: %.c
$(MKDIR) $(dir $@)
$(CC) $(CFLAGS) -c $< -o $@
###########################################################################