-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGNUmakefile
215 lines (199 loc) · 6.15 KB
/
GNUmakefile
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
# OpenDoors 6.23
# (C} Copyright 1991 - 1997 by Brian Pirie. All Rights Reserved.
#
# Oct-2001 door32.sys/socket modifications by Rob Swindell (www.synchro.net}
#
#
# File: Win32.mak
#
# Description: Makefile used to build the Win32 OpenDoors libraries from
# the sources. Usage is described below.
#
# Revisions: Date Ver Who Change
# ---------------------------------------------------------------
# Aug 09, 2003 6.23 SH *nix port
#
###############################################################################
#
# USAGE INFORMATION
#
###############################################################################
#
# Command Line: make -fWin32.mak
# or
# nmake /f Win32.mak
#
###############################################################################
#
# CONFIGURATION
#
# Customize this section of the makefile to provide the relevant information
# for your compiler, assembler (if any} and build environment.
#
###############################################################################
# Compiler executable file name. Use:
#
# tcc - For Borland Turbo C and Turbo C++
# bcc - For Borland C++
# cl - For Microsoft compilers
#
CC := gcc
#
#------------------------------------------------------------------------------
#
# Linker executable file name. Use:
#
# tlink - For Borland compilers
# link - For Microsoft compilers
#
# Get OS name
OS := $(shell uname)
os := $(shell echo $(OS) | tr '[A-Z]' '[a-z]' | tr ' ' '_')
OBJDIR := objs-$(OS)/
LIBDIR := libs-$(OS)/
EXEDIR := exe-$(OS)/
LD := gcc
ifdef DEBUG
CFLAGS += -g -DOD_DEBUG
BUILDTYPE := debug
else
BUILDTYPE := release
endif
#
#------------------------------------------------------------------------------
#
# Compiler command-line flags.
#
CFLAGS += -fPIC
LDFLAGS += -fPIC
CFLAGS += -O2 -L${LIBDIR} -I../xpdev -Wall
ifeq ($(OS),Darwin)
CFLAGS += -D__unix__
LDFLAGS += $(CFLAGS) -dynamiclib -single_module
else
LDFLAGS += $(CFLAGS) -shared
endif
ifeq ($(shell if [ -f /usr/include/inttypes.h ] ; then echo YES ; fi),YES)
CFLAGS += -DHAS_INTTYPES_H
endif
# /MTd /Zi - for debug
#
#------------------------------------------------------------------------------
#
# Link flags.
#
LDFLAGS += -L../xpdev/$(LD).$(os).lib.$(BUILDTYPE)
#
#------------------------------------------------------------------------------
#
# Output directories. customize for your own preferences. Note that trailing
# backslash (\} characters are required.
#
SHLIB := .so
STATICLIB := .a
OBJFILE := .o
ifdef PROFILE
CFLAGS += -pg
SHLIB := _p${SHLIB}
STATICLIB := _p.a
endif
#
###############################################################################
#
# DEPENDENCIES
#
# You won't normally have to change anything after this point in this makefile.
#
###############################################################################
#
# Define primary target.
#
all: ${OBJDIR} ${LIBDIR} $(EXEDIR) ${LIBDIR}libODoors${SHLIB} \
${LIBDIR}libODoors${STATICLIB} $(EXEDIR)ex_chat $(EXEDIR)ex_diag \
$(EXEDIR)ex_hello $(EXEDIR)ex_music $(EXEDIR)ex_ski $(EXEDIR)ex_vote
#
#------------------------------------------------------------------------------
#
# Name of all headers.
#
HEADERS= ${HEADERDIR}ODCom.h\
${HEADERDIR}ODCore.h\
${HEADERDIR}ODGen.h\
${HEADERDIR}ODInEx.h\
${HEADERDIR}ODInQue.h\
${HEADERDIR}ODKrnl.h\
${HEADERDIR}ODPlat.h\
${HEADERDIR}ODRes.h\
${HEADERDIR}ODScrn.h\
${HEADERDIR}ODStat.h\
${HEADERDIR}ODSwap.h\
${HEADERDIR}ODTypes.h\
${HEADERDIR}ODUtil.h\
${HEADERDIR}OpenDoor.h
#
#------------------------------------------------------------------------------
#
# Build DLL from objects.
#
OBJECTS := ${OBJDIR}ODAuto${OBJFILE}\
${OBJDIR}ODBlock${OBJFILE}\
${OBJDIR}ODCFile${OBJFILE}\
${OBJDIR}ODCmdLn${OBJFILE}\
${OBJDIR}ODCom${OBJFILE}\
${OBJDIR}ODCore${OBJFILE}\
${OBJDIR}ODDrBox${OBJFILE}\
${OBJDIR}ODEdit${OBJFILE}\
${OBJDIR}ODEdStr${OBJFILE}\
${OBJDIR}ODEmu${OBJFILE}\
${OBJDIR}ODGetIn${OBJFILE}\
${OBJDIR}ODGraph${OBJFILE}\
${OBJDIR}ODInEx1${OBJFILE}\
${OBJDIR}ODInEx2${OBJFILE}\
${OBJDIR}ODInQue${OBJFILE}\
${OBJDIR}ODKrnl${OBJFILE}\
${OBJDIR}ODList${OBJFILE}\
${OBJDIR}ODLog${OBJFILE}\
${OBJDIR}ODMulti${OBJFILE}\
${OBJDIR}ODPlat${OBJFILE}\
${OBJDIR}ODPCB${OBJFILE}\
${OBJDIR}ODPopup${OBJFILE}\
${OBJDIR}ODPrntf${OBJFILE}\
${OBJDIR}ODRA${OBJFILE}\
${OBJDIR}ODScrn${OBJFILE}\
${OBJDIR}ODSpawn${OBJFILE}\
${OBJDIR}ODStand${OBJFILE}\
${OBJDIR}ODStat${OBJFILE}\
${OBJDIR}ODStr${OBJFILE}\
${OBJDIR}ODUtil${OBJFILE}\
${OBJDIR}ODWCat${OBJFILE}\
${OBJDIR}ODWin${OBJFILE}
# ${OBJDIR}ODoor.res
# ${OBJDIR}odsys${OBJFILE}\ this file is missing
${OBJDIR}:
mkdir ${OBJDIR}
${LIBDIR}:
mkdir ${LIBDIR}
${EXEDIR}:
mkdir ${EXEDIR}
$(OBJDIR)%$(OBJFILE) : %.c
$(CC) $(CFLAGS) -o $@ -c $<
${LIBDIR}libODoors${SHLIB} : ${OBJECTS}
$(LD) $(LDFLAGS) -o ${LIBDIR}libODoors${SHLIB}.6.2 ${OBJECTS}
ln -fs libODoors${SHLIB}.6.2 ${LIBDIR}libODoors${SHLIB}
${LIBDIR}libODoors${STATICLIB} : ${OBJECTS}
ar -r ${LIBDIR}libODoors${STATICLIB} ${OBJECTS}
ranlib ${LIBDIR}libODoors${STATICLIB}
${EXEDIR}ex_chat: ex_chat.c ${LIBDIR}libODoors${SHLIB}
$(CC) $(CFLAGS) ex_chat.c -o $@ -lODoors
${EXEDIR}ex_diag: ex_diag.c ${LIBDIR}libODoors${SHLIB}
$(CC) $(CFLAGS) ex_diag.c -o $@ -lODoors
${EXEDIR}ex_hello: ex_hello.c ${LIBDIR}libODoors${SHLIB}
$(CC) $(CFLAGS) ex_hello.c -o $@ -lODoors
${EXEDIR}ex_music: ex_music.c ${LIBDIR}libODoors${SHLIB}
$(CC) $(CFLAGS) ex_music.c -o $@ -lODoors
${EXEDIR}ex_ski: ex_ski.c ${LIBDIR}libODoors${SHLIB}
$(CC) $(LDFLAGS) ex_ski.c -o $@ -lODoors -lxpdev
${EXEDIR}ex_vote: ex_vote.c ${LIBDIR}libODoors${SHLIB}
$(CC) $(CFLAGS) ex_vote.c ../xpdev/filewrap.c -o $@ -lODoors -DMULTINODE_AWARE
#
#------------------------------------------------------------------------------