/
Makefile
168 lines (128 loc) · 4.45 KB
/
Makefile
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
#---------------------------------------------------------------------------
# Makefile by Ryan C. Gordon (icculus@lokigames.com)
#---------------------------------------------------------------------------
# should be 386, mmx, 686, or other.
#
# 386 and 486 chips use "386"
# Pentiums, Celerons, PentiumMMX should use "mmx"
# PentiumPro, PII, PIII, K6, Cyrix686/MII, Athlon, etc. should use "686"
# PowerPC and other non-x86 chips should use "other"
cpu=686
# Are you debugging? Specify "true". Release binaries? "false".
debug=true
# want to see more verbose compiles? Set this to "true".
verbose=false
# You probably don't need to touch this one. This is the location of
# your copy of PPC386, if it's not in the path.
# Get this from http://www.freepascal.org/ ...
PPC386=ppc386
#---------------------------------------------------------------------------
# don't touch anything below this line.
ifeq ($(strip $(verbose)),true)
PPC386FLAGS += -vwnh
endif
ifeq ($(strip $(debug)),true)
BUILDDIR := $(cpu)/Debug
PPC386FLAGS += -g # include debug symbols.
PPC386FLAGS += -gc # generate checks for pointers.
PPC386FLAGS += -Ct # generate stack-checking code.
PPC386FLAGS += -Cr # generate range-checking code.
PPC386FLAGS += -Co # generate overflow-checking code.
PPC386FLAGS += -Ci # generate I/O-checking code.
else
BUILDDIR := $(cpu)/Release
PPC386FLAGS += -Xs # strip the binary.
PPC386FLAGS += -O2 # Level 2 optimizations.
PPC386FLAGS += -OG # Optimize for speed, not size.
PPC386FLAGS += -XD # Dynamic linkage.
PPC386FLAGS += -CX # Smartlink the binary, removing unused code.
ifeq ($(strip $(cpu)),386)
PPC386FLAGS += -OP1
else
ifeq ($(strip $(cpu)),mmx)
PPC386FLAGS += -OP2
else
ifeq ($(strip $(cpu)),686)
PPC386FLAGS += -OP3
endif
endif
endif
endif
# Rebuild all units needed.
PPC386FLAGS += -B
# Borland TP7.0 compatibility flag.
PPC386FLAGS += -So
# Allow LABEL and GOTO. STRIVE TO REMOVE THIS COMMAND LINE PARAMETER!
PPC386FLAGS += -Sg
# Support C-style macros.
#PPC386FLAGS += -Sm
# Assembly statements are Intel-like (instead of AT&T-like).
PPC386FLAGS += -Rintel
# Output target Linux. !!! FIXME: Want win32 compiles?
PPC386FLAGS += -TLINUX
# Pipe output to assembler, rather than to temp file. This is a little faster.
#PPC386FLAGS += -P
# Write bins to this directory...
PPC386FLAGS += -FE$(BUILDDIR)
# This are the names of the produced binaries.
MAINEXE=$(BUILDDIR)/bbs
MINITERMEXE=$(BUILDDIR)/miniterm
INITEXE=$(BUILDDIR)/init
TPAGEEXE=$(BUILDDIR)/tpage
IFLEXE=$(BUILDDIR)/ifl
FINDITEXE=$(BUILDDIR)/findit
T2TEXE=$(BUILDDIR)/t2t
OBLITEXE=$(BUILDDIR)/oblit
MTESTEXE=$(BUILDDIR)/mtest
BBEXE=$(BUILDDIR)/bb
CBBSEXE=$(BUILDDIR)/cbbs
MABSEXE=$(BUILDDIR)/mabs
COCONFIGEXE=$(BUILDDIR)/coconfig
SPDATEEXE=$(BUILDDIR)/spdate
#---------------------------------------------------------------------------
# Build rules...don't touch this, either.
#include sources
#OBJSx := $(SRCS:.pas=.o)
#OBJS := $(foreach feh,$(OBJSx),$(BUILDDIR)/$(feh))
$(BUILDDIR)/%.o : %.pas
$(PPC386) $(PPC386FLAGS) $<
all: $(BUILDDIR) $(MAINEXE) $(INITEXE) #\
$(MINITERMEXE) $(TPAGEEXE) $(IFLEXE) \
$(FINDITEXE) $(OBLITEXE) $(MTESTEXE) $(BBEXE) $(CBBSEXE) \
$(MABSEXE) $(COCONFIGEXE) $(SPDATEEXE) $(T2TEXE)
$(MAINEXE) : $(BUILDDIR) bbs.pas
$(PPC386) $(PPC386FLAGS) bbs.pas
$(MINITERMEXE) : $(BUILDDIR) miniterm.pas
$(PPC386) $(PPC386FLAGS) miniterm.pas
$(INITEXE) : $(BUILDDIR) init.pas
$(PPC386) $(PPC386FLAGS) init.pas
$(TPAGEEXE) : $(BUILDDIR) tpage.pas
$(PPC386) $(PPC386FLAGS) tpage.pas
$(IFLEXE) : $(BUILDDIR) ifl.pas
$(PPC386) $(PPC386FLAGS) ifl.pas
$(FINDITEXE) : $(BUILDDIR) findit.pas
$(PPC386) $(PPC386FLAGS) findit.pas
$(T2TEXE) : $(BUILDDIR) t2t.pas
$(PPC386) $(PPC386FLAGS) t2t.pas
$(OBLITEXE) : $(BUILDDIR) oblit.pas
$(PPC386) $(PPC386FLAGS) oblit.pas
$(MTESTEXE) : $(BUILDDIR) mtest.pas
$(PPC386) $(PPC386FLAGS) mtest.pas
$(BBEXE) : $(BUILDDIR) bb.pas
$(PPC386) $(PPC386FLAGS) bb.pas
$(CBBSEXE) : $(BUILDDIR) cbbs.pas
$(PPC386) $(PPC386FLAGS) cbbs.pas
$(MABSEXE) : $(BUILDDIR) mabs.pas
$(PPC386) $(PPC386FLAGS) mabs.pas
$(COCONFIGEXE) : $(BUILDDIR) coconfig.pas
$(PPC386) $(PPC386FLAGS) coconfig.pas
$(SPDATEEXE) : $(BUILDDIR) spdate.pas
$(PPC386) $(PPC386FLAGS) spdate.pas
$(BUILDDIR): $(cpu)
mkdir $(BUILDDIR)
$(cpu):
mkdir $(cpu)
clean:
rm -rf $(BUILDDIR)
rm -rf core
# end of Makefile ...