-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGMakefile
54 lines (44 loc) · 1.68 KB
/
GMakefile
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
# Project: SF3KtoProT
# To use this makefile on RISC OS, you must set UnixEnv$sed$sfix and
# UnixEnv$make$sfix to include ":debug:d" so that filename suffixes are
# translated automatically into directory names
# Tools
CC = gcc
Link = gcc
# Make cannot understand rules which contain RISC OS path names such as /C:Macros.h as prerequisites, so strip them from the dynamic dependencies
StripBadPre = sed -r 's@/[A-Za-z]+:[^ ]*@@g' < $*T.d >
DeleteTempDep = delete d.$*T
# Toolflags:
CCCommonFlags = -c -IC: -DACORN_C -mlibscl -mthrowback -Wall -Wextra -pedantic -std=c99 -MMD -MP -MF $*T.d -o $@
CCFlags = $(CCCommonFlags) -DNDEBUG -O3
CCDebugFlags = $(CCCommonFlags) -g -DUSE_CBDEBUG -DDEBUG_OUTPUT -DFORTIFY
LinkCommonFlags = -LC: -mlibscl -o $@
LinkFlags = $(LinkCommonFlags) $(addprefix -l,$(ReleaseLibs))
LinkDebugFlags = $(LinkCommonFlags) $(addprefix -l,$(DebugLibs))
include MakeCommon
DebugObjects = $(addsuffix .debug,$(ObjectList))
ReleaseObjects = $(addsuffix .o,$(ObjectList))
DebugLibs = CBDebug CBUtildbg Streamdbg GKeydbg Fortify
ReleaseLibs = CBUtil Stream GKey
# Final targets:
all: SF3KtoProT SF3KtoProTD
SF3KtoProT: $(ReleaseObjects)
$(Link) $(LinkFlags) $(ReleaseObjects)
SF3KtoProTD: $(DebugObjects)
$(Link) $(LinkDebugFlags) $(DebugObjects)
# User-editable dependencies:
.SUFFIXES: .o .c .debug
.c.debug:
$(CC) $(CCDebugFlags) $<
$(StripBadPre) $*D.d
$(DeleteTempDep)
.c.o:
$(CC) $(CCFlags) $<
$(StripBadPre) $*.d
$(DeleteTempDep)
# Static dependencies:
# Dynamic dependencies:
# These files are generated during compilation to track C header #includes.
# It's not an error if they don't exist.
-include $(addsuffix .d,$(ObjectList))
-include $(addsuffix D.d,$(ObjectList))