forked from tbdye/cnet-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
221 lines (177 loc) · 6.76 KB
/
Copy pathMakefile
File metadata and controls
221 lines (177 loc) · 6.76 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
# CNet 5 SDK - Top-level Makefile
#
# Cross-compile CNet doors, utilities, and tools for AmigaOS (m68k).
#
# Programs fall into three categories:
# 1. CNetC doors - use CNCL_DoorInit or CNC_InitContext, link with libcnet_door.a
# 2. Standalone - use FindPort("cnetport") directly, no door framework
# 3. Raw CMessage - v3-style doors using CallHost(), link with libcnet_door.a
#
# Some standalone utilities also link against cnet.library or cnet4.library
# at runtime but do not need the door static library at compile time.
CC = /opt/amiga/bin/m68k-amigaos-gcc
CFLAGS = -noixemul -m68020 -O2 -Wall -Wno-pointer-sign -Iinclude -Iinclude/cnet
LDFLAGS = -noixemul
LIBS = -Llib -lcnet_door
# ---------------------------------------------------------------------------
# CNetC door examples (use CNCL_DoorInit or CNC_InitContext, need libcnet_door.a)
# ---------------------------------------------------------------------------
CNETC_DOORS = \
examples/empty \
examples/CNetCTest \
examples/NewEmptyCTest \
examples/FindHandle \
examples/PortStatus \
examples/PortStatus2 \
examples/PortStatus3 \
examples/SubListVars \
examples/WFI_Test \
examples/RangeTest \
examples/RangeTest2 \
examples/dirsize \
examples/ansidetect \
examples/MenuBits \
examples/identdtest \
examples/TestOpenDisplay \
examples/showunval
# ---------------------------------------------------------------------------
# Standalone utilities (FindPort for MainPort, no door library needed)
# ---------------------------------------------------------------------------
STANDALONE = \
examples/GetMainPort \
examples/mainporttest \
examples/ShowTelnetHosts \
examples/ShowIdleTime \
examples/setIdleTime \
examples/setsplitchat \
examples/SetZPos \
examples/OneKeyInject \
examples/RegistrationInfo \
examples/implist \
examples/listsubsem \
examples/identtestdos
# Standalone utilities that need cnet.library (opened at runtime, not linked)
STANDALONE_CNETLIB = \
examples/ZGettest \
examples/ReadDirTest \
examples/ReadDirTest2 \
examples/CNetFileFind \
examples/verifymailsem
# Standalone utilities that need cnet.library AND libcnet_door.a (for LongToDate)
STANDALONE_CNETLIB_DOORUTIL = \
examples/ListEvents
# Standalone utilities that need cnet.library AND cnet4.library
STANDALONE_CNET4 = \
examples/dos_uptime \
examples/DosDoor2
# Standalone utilities that need bsdsocket.library
STANDALONE_BSDSOCK = \
examples/listdcc
# Standalone using DOS I/O only (no CNet libraries)
STANDALONE_DOSONLY = \
examples/DosDoor
# Standalone needing custom DOSBase handling (no startup code)
STANDALONE_NOSTARTUP = \
examples/listmailsem
# ---------------------------------------------------------------------------
# Raw CMessage doors (v3-style, link with libcnet_door.a for CallHost)
# ---------------------------------------------------------------------------
RAW_DOORS = \
examples/WaitForC \
examples/identdlookup
# ---------------------------------------------------------------------------
# Code snippets (not standalone programs, cannot be compiled alone)
# ---------------------------------------------------------------------------
# examples/CheckOnline.c - function snippet, no main()
# examples/mailsend.c - function snippet with syntax errors, no main()
# ---------------------------------------------------------------------------
# Templates
# ---------------------------------------------------------------------------
TEMPLATES = \
templates/pfile_cnetc \
templates/pfile_raw \
templates/standalone
# ---------------------------------------------------------------------------
# Tools
# ---------------------------------------------------------------------------
TOOLS = \
tools/guoffset \
tools/libinfo \
tools/structsizes
# ---------------------------------------------------------------------------
# Tests (CNetC doors that exercise SDK functionality)
# ---------------------------------------------------------------------------
TESTS_DOOR = \
tests/test_hello \
tests/test_userdata \
tests/test_library \
tests/test_structsizes
TESTS_STANDALONE = \
tests/test_headers
TESTS = $(TESTS_DOOR) $(TESTS_STANDALONE)
# ---------------------------------------------------------------------------
# Aggregate targets
# ---------------------------------------------------------------------------
ALL_EXAMPLES = $(CNETC_DOORS) $(STANDALONE) $(STANDALONE_CNETLIB) \
$(STANDALONE_CNETLIB_DOORUTIL) \
$(STANDALONE_CNET4) $(STANDALONE_BSDSOCK) $(STANDALONE_DOSONLY) \
$(STANDALONE_NOSTARTUP) $(RAW_DOORS)
ALL_TARGETS = $(ALL_EXAMPLES) $(TEMPLATES) $(TOOLS) $(TESTS)
.PHONY: all clean lib examples templates tools tests
all: lib examples templates tools
lib:
$(MAKE) -C lib
examples: lib $(ALL_EXAMPLES)
templates: lib $(TEMPLATES)
tools: $(TOOLS)
# ---------------------------------------------------------------------------
# Build rules
# ---------------------------------------------------------------------------
# CNetC doors need the door library
$(CNETC_DOORS): %: %.c lib
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< $(LIBS)
# Standalone utilities don't need the door library
$(STANDALONE): %: %.c
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $<
$(STANDALONE_CNETLIB): %: %.c
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $<
# Standalone with cnet.library AND libcnet_door.a for utility functions
$(STANDALONE_CNETLIB_DOORUTIL): %: %.c lib
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< $(LIBS)
$(STANDALONE_CNET4): %: %.c
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $<
$(STANDALONE_BSDSOCK): %: %.c
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $<
$(STANDALONE_DOSONLY): %: %.c
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $<
$(STANDALONE_NOSTARTUP): %: %.c
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $<
# Raw doors need the door library for CallHost/CMessage support
$(RAW_DOORS): %: %.c lib
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< $(LIBS)
# CNetC and raw door templates need the door library
templates/pfile_cnetc: templates/pfile_cnetc.c lib
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< $(LIBS)
templates/pfile_raw: templates/pfile_raw.c lib
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< $(LIBS)
# Standalone template does NOT need the door library
templates/standalone: templates/standalone.c
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $<
# Tools
tools/guoffset: tools/guoffset.c
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $<
tools/libinfo: tools/libinfo.c
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $<
tools/structsizes: tools/structsizes.c
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $<
# Tests
tests: lib $(TESTS)
# Door tests need the door library
$(TESTS_DOOR): %: %.c lib
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< $(LIBS)
# Standalone tests don't need the door library
$(TESTS_STANDALONE): %: %.c
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $<
clean:
$(MAKE) -C lib clean
rm -f $(ALL_TARGETS)