-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathGNUmakefile.cmn
171 lines (143 loc) · 3.13 KB
/
GNUmakefile.cmn
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
#
# we can now use the Alcyon compiler as cross-compiler on linux ;)
#
ifeq ($(USE_CROSS_ALCYON),)
EVAL_CROSS := case `uname -s` in *MiNT*|*TOS*) echo no;; *) echo yes; esac
CROSS := $(shell $(EVAL_CROSS))
ifeq ($(CROSS),yes)
USE_CROSS_ALCYON=1
endif
EVAL_WIN32 := case `uname -s` in *MINGW*|CYGWIN*) echo 1;; *) echo 0; esac
WIN32 := $(shell $(EVAL_WIN32))
endif
ifeq ($(USE_CROSS_ALCYON),1)
ifeq ($(WIN32),1)
BIN=../bin/win32/
else
BIN=../bin/linux/
endif
else
BIN=../bin/tos/
endif
LIB=../lib/
INC=../include
DISTDIR1=../tmp/tos306de
DISTDIR2=../tmp/alcyon
DOSDIR=/mnt/tos/TOS
WWWDIR=$(HOME)/webgo24/home/www/download
LOCAL_WWWDIR=/srv/www/htdocs/tospatch/src
ALNPATH=${LIB}
CRT0=crt0.o
LIBC=libc.a
LIBC_NDX=
LIBM=libm.a
LIBM_NDX=
BS=/
QBS=\${empty}
#
# target and host compiler
#
ifeq ($(USE_CROSS_ALCYON),1)
EXEEXT=.ttp
ifeq ($(WIN32),1)
BUILD_EXEEXT=.exe
else
BUILD_EXEEXT=
endif
CROSSPREFIX=m68k-atari-mint-
CC = $(BIN)cc68
CPP = $(CC) $(CPPFLAGS) -E -P
CPPOUT = -o
LD = $(CC)
AS = $(CC)
AR = ${BIN}ar68
LINK68 = ${BIN}link68
RELMOD = ${BIN}relmod
ARFLAGS = -r
RANLIB = :
STRIP = $(CROSSPREFIX)strip
FLAGS = $(CROSSPREFIX)flags
else
ifeq ($(CROSS),yes)
CROSSPREFIX=m68k-atari-mint-
EXEEXT=.ttp
ifeq ($(WIN32),1)
BUILD_EXEEXT=.exe
else
BUILD_EXEEXT=
endif
else
CROSSPREFIX=
EXEEXT=
BUILD_EXEEXT=$(EXEEXT)
endif
BUILD_CC = gcc
BUILD_CFLAGS = -O -Wall
CC = $(CROSSPREFIX)gcc -g -mshort -Werror -ffreestanding -fno-builtin-memcpy
CPP = $(CC) -xc $(CPPFLAGS) -E -P
CPPOUT = -o
LD = $(CC)
AS = $(CC) -Wa,--mri
AR = $(CROSSPREFIX)ar
ARFLAGS = rcs
RANLIB = $(CROSSPREFIX)ranlib
STRIP = $(CROSSPREFIX)strip
FLAGS = $(CROSSPREFIX)flags
endif
#
# some tools
#
MV = mv
CP = cp
RM = rm -f
TOUCH = touch
MKDIR = mkdir
MKDIR_P = $(MKDIR) -p
SED = sed
BC = bc
DC = dc
GREP = grep
TR = tr
CMP = $(top_srcdir)/tools/cmprom$(BUILD_EXEEXT)
MKGLUE = $(top_srcdir)/tools/newglue$(BUILD_EXEEXT)
MKBININC = $(top_srcdir)/tools/mkbininc$(BUILD_EXEEXT)
MKROM = $(top_srcdir)/tools/mkrom$(BUILD_EXEEXT)
# Wether to run the optimizer pass for Alcyon.
# the default is evaluated by RUN_OPTIMIZE_,
# which must be either ${RUN_OPTIMIZE_0} or ${RUN_OPTIMIZE_1}.
# It can be overridden by specifying foo_OPTIMIZE=0
# for individual files.
RUN_OPTIMIZE_0 =
RUN_OPTIMIZE_1 = --optimize
RUN_OPTIMIZE_ = ${RUN_OPTIMIZE_1}
#
# optimizations
#
OPTS = -O2 -fomit-frame-pointer
#
# warning options
#
WARN = \
-Wall \
-Wstrict-prototypes \
-Wmissing-prototypes \
-Wshadow \
-Wpointer-arith \
-Wcast-qual \
-Waggregate-return \
-Wundef
.c.o:
$(AM_V_CC)$(CC) $(CFLAGS) $(CPPFLAGS) ${RUN_OPTIMIZE_${$*_OPTIMIZE}} -c -o $@ $<
.s.o:
$(AM_V_AS)$(AS) $(ASFLAGS) $(CPPFLAGS) -c -o $@ $<
.S.o:
$(AM_V_AS)$(CC) -Wa,--mri $(ASFLAGS) $(CPPFLAGS) ${$*_ASFLAGS} -c -o $@ $<
#
# The final ROM image contains two versions of this compiler
# support functions. In order to avoid duplicate symbols,
# and because they are slightly different,
# we have to rename one of those
# (we use the ones from bdos since they are referenced less often)
#
SUBSTLMUL = $(SED) -e 's/lmul/bdoslmul/' $*.s > $*.i; $(MV) $*.i $*.s
SUBSTLDIV = $(SED) -e 's/ldiv/bdosldiv/' $*.s > $*.i; $(MV) $*.i $*.s