summaryrefslogtreecommitdiff
path: root/os2/Makefile.in
blob: 4f2278ba9b37bbd95b8eed4f4edf366ed6a0d41e (plain)
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
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
# Makefile for OS/2.  Generated from Makefile.in when CVS is
# configured for a dist-build.  Configure never gets run on OS/2, so
# we must include the generated Makefile in the distribution.  See the
# `dist-dir' rule.

project: cvs.exe
# .SUFFIXES .c .obj .exe

# path slash.  This was introduced so that it can be set to \
# instead of / for linking, but now that the cvs.exe rule uses
# subst to produce \, it should be possible to nuke SL.
# FIXME - nuke SL
SL = /

# Directory in which to install executables.
install_dir = s:${SL}gnu${SL}util

# srcdir is usually "."
srcdir     = @srcdir@

# top_srcdir is usually ".."
top_srcdir = @top_srcdir@

VPATH      = @srcdir@
subdir     = os2

lib_dir     = @top_srcdir@${SL}lib
cvs_srcdir = @top_srcdir@${SL}src

zlib_dir = ${top_srcdir}/zlib

# Do we need these?
# prefix = /usr/local
# exec_prefix = ${prefix}

# taken straight from the example project
LIB = s:${SL}ibmcpp${SL}lib;s:${SL}toolkt21${SL}os2lib;
CINC = -Is:${SL}ibmcpp${SL}include -Is:${SL}toolkt21${SL}c${SL}os2h
# This says we are building an object file, not a full executable.
OBJ_CFLAGS = -C+
CFLAGS = -W3 -Wrea+tru+ -Ti+ -Ss+ -Gd- -Gm+ -G4 -Q+ -Sm ${CINC} \
  -I${srcdir} -I${lib_dir} -I${cvs_srcdir} -I${zlib_dir} \
  -DIBM_CPP -DHAVE_CONFIG_H \
  -DTCPIP_IBM -Is:${SL}ibmtcpip${SL}include

# needed to make command-line wildcard expansion work right.  That's
# right, DOS-descendants handle this from the program, not the shell.
ARGVLIB = s:${SL}ibmcpp${SL}lib${SL}setargv.obj

# TCP/IP stuff
TCPIPLIB = s:${SL}ibmtcpip${SL}lib${SL}tcp32dll.lib	s:${SL}ibmtcpip${SL}lib${SL}so32dll.lib


# headers specific to OS/2

# We list OS2_HEADERS so we know what to include when we make dist-dir
# here.
OS2_HEADERS = \
       tcpip.h \
       config.h \
       pwd.h \
       dirent.h \
       rcmd.h \
       popen.h

# headers we use from the common src dir, ..${SL}src
COMMON_HEADERS = \
       ${cvs_srcdir}${SL}client.h \
       ${cvs_srcdir}${SL}cvs.h \
       ${cvs_srcdir}${SL}rcs.h \
       ${cvs_srcdir}${SL}hash.h \
       ${cvs_srcdir}${SL}myndbm.h \
       ${cvs_srcdir}${SL}patchlevel.h \
       ${cvs_srcdir}${SL}update.h \
       ${cvs_srcdir}${SL}server.h \
       ${cvs_srcdir}${SL}error.h

# sources specific to OS/2
OS2_SOURCES = \
       mkdir.c \
       pwd.c \
       filesubr.c \
       dirent.c \
       run.c \
       rcmd.c \
       waitpid.c \
       popen.c \
       porttcp.c \
       getpass.c

# sources we use from the common src dir, ..${SL}src
# FIXME: Is this used anywhere?  I don't think it is.
COMMON_SOURCES = \
       ${cvs_srcdir}${SL}add.c \
       ${cvs_srcdir}${SL}admin.c \
       ${cvs_srcdir}${SL}buffer.c \
       ${cvs_srcdir}${SL}checkin.c \
       ${cvs_srcdir}${SL}checkout.c \
       ${cvs_srcdir}${SL}classify.c \
       ${cvs_srcdir}${SL}client.c \
       ${cvs_srcdir}${SL}commit.c \
       ${cvs_srcdir}${SL}create_adm.c \
       ${cvs_srcdir}${SL}cvsrc.c \
       ${cvs_srcdir}${SL}diff.c \
       ${cvs_srcdir}${SL}edit.c \
       ${cvs_srcdir}${SL}entries.c \
       ${cvs_srcdir}${SL}error.c \
       ${cvs_srcdir}${SL}expand_path.c \
       ${cvs_srcdir}${SL}fileattr.c \
       ${cvs_srcdir}${SL}find_names.c \
       ${cvs_srcdir}${SL}hash.c \
       ${cvs_srcdir}${SL}history.c \
       ${cvs_srcdir}${SL}ignore.c \
       ${cvs_srcdir}${SL}import.c \
       ${cvs_srcdir}${SL}lock.c \
       ${cvs_srcdir}${SL}log.c \
       ${cvs_srcdir}${SL}login.c \
       ${cvs_srcdir}${SL}logmsg.c \
       ${cvs_srcdir}${SL}main.c \
       ${cvs_srcdir}${SL}mkmodules.c \
       ${cvs_srcdir}${SL}modules.c \
       ${cvs_srcdir}${SL}myndbm.c \
       ${cvs_srcdir}${SL}no_diff.c \
       ${cvs_srcdir}${SL}parseinfo.c \
       ${cvs_srcdir}${SL}patch.c \
       ${cvs_srcdir}${SL}rcs.c \
       ${cvs_srcdir}${SL}rcscmds.c \
       ${cvs_srcdir}${SL}recurse.c \
       ${cvs_srcdir}${SL}release.c \
       ${cvs_srcdir}${SL}remove.c \
       ${cvs_srcdir}${SL}repos.c \
       ${cvs_srcdir}${SL}root.c \
       ${cvs_srcdir}${SL}scramble.c \
       ${cvs_srcdir}${SL}server.c \
       ${cvs_srcdir}${SL}status.c \
       ${cvs_srcdir}${SL}subr.c \
       ${cvs_srcdir}${SL}tag.c \
       ${cvs_srcdir}${SL}update.c \
       ${cvs_srcdir}${SL}watch.c \
       ${cvs_srcdir}${SL}wrapper.c \
       ${cvs_srcdir}${SL}vers_ts.c \
       ${cvs_srcdir}${SL}version.c
# end of $COMMON_SOURCES

# sources from ..${SL}lib
# FIXME: Is this used anywhere?  I don't think it is.
LIB_SOURCES = \
       ${lib_dir}${SL}getdate.c \
       ${lib_dir}${SL}getopt.c \
       ${lib_dir}${SL}getopt1.c \
       ${lib_dir}${SL}getline.c \
       ${lib_dir}${SL}getwd.c \
       ${lib_dir}${SL}savecwd.c \
       ${lib_dir}${SL}sighandle.c \
       ${lib_dir}${SL}yesno.c \
       ${lib_dir}${SL}vasprintf.c \
       ${lib_dir}${SL}xgetwd.c \
       ${lib_dir}${SL}md5.c \
       ${lib_dir}${SL}fnmatch.c \
       ${lib_dir}${SL}regex.c

# object files from OS/2 sources
OS2_OBJECTS = \
       ${srcdir}${SL}mkdir.obj \
       ${srcdir}${SL}pwd.obj \
       ${srcdir}${SL}filesubr.obj \
       ${srcdir}${SL}dirent.obj \
       ${srcdir}${SL}run.obj \
       ${srcdir}${SL}rcmd.obj \
       ${srcdir}${SL}waitpid.obj \
       ${srcdir}${SL}popen.obj \
       ${srcdir}${SL}porttcp.obj \
       ${srcdir}${SL}getpass.obj

# object files from ..${SL}src
COMMON_OBJECTS = \
       ${cvs_srcdir}${SL}add.obj \
       ${cvs_srcdir}${SL}admin.obj \
       ${cvs_srcdir}${SL}buffer.obj \
       ${cvs_srcdir}${SL}checkin.obj \
       ${cvs_srcdir}${SL}checkout.obj \
       ${cvs_srcdir}${SL}classify.obj \
       ${cvs_srcdir}${SL}client.obj \
       ${cvs_srcdir}${SL}commit.obj \
       ${cvs_srcdir}${SL}create_adm.obj \
       ${cvs_srcdir}${SL}cvsrc.obj \
       ${cvs_srcdir}${SL}diff.obj \
       ${cvs_srcdir}${SL}edit.obj \
       ${cvs_srcdir}${SL}entries.obj \
       ${cvs_srcdir}${SL}error.obj \
       ${cvs_srcdir}${SL}expand_path.obj \
       ${cvs_srcdir}${SL}fileattr.obj \
       ${cvs_srcdir}${SL}find_names.obj \
       ${cvs_srcdir}${SL}hash.obj \
       ${cvs_srcdir}${SL}history.obj \
       ${cvs_srcdir}${SL}ignore.obj \
       ${cvs_srcdir}${SL}import.obj \
       ${cvs_srcdir}${SL}lock.obj \
       ${cvs_srcdir}${SL}log.obj \
       ${cvs_srcdir}${SL}login.obj \
       ${cvs_srcdir}${SL}logmsg.obj \
       ${cvs_srcdir}${SL}main.obj \
       ${cvs_srcdir}${SL}mkmodules.obj \
       ${cvs_srcdir}${SL}modules.obj \
       ${cvs_srcdir}${SL}myndbm.obj \
       ${cvs_srcdir}${SL}no_diff.obj \
       ${cvs_srcdir}${SL}parseinfo.obj \
       ${cvs_srcdir}${SL}patch.obj \
       ${cvs_srcdir}${SL}rcs.obj \
       ${cvs_srcdir}${SL}rcscmds.obj \
       ${cvs_srcdir}${SL}recurse.obj \
       ${cvs_srcdir}${SL}release.obj \
       ${cvs_srcdir}${SL}remove.obj \
       ${cvs_srcdir}${SL}repos.obj \
       ${cvs_srcdir}${SL}root.obj \
       ${cvs_srcdir}${SL}scramble.obj \
       ${cvs_srcdir}${SL}server.obj \
       ${cvs_srcdir}${SL}status.obj \
       ${cvs_srcdir}${SL}subr.obj \
       ${cvs_srcdir}${SL}tag.obj \
       ${cvs_srcdir}${SL}update.obj \
       ${cvs_srcdir}${SL}watch.obj \
       ${cvs_srcdir}${SL}wrapper.obj \
       ${cvs_srcdir}${SL}vers_ts.obj \
       ${cvs_srcdir}${SL}version.obj \
       ${cvs_srcdir}/zlib.obj
# end of $COMMON_OBJECTS

# objects from ..${SL}lib
LIB_OBJECTS = \
       ${lib_dir}${SL}getdate.obj \
       ${lib_dir}${SL}getopt.obj \
       ${lib_dir}${SL}getopt1.obj \
       ${lib_dir}${SL}getline.obj \
       ${lib_dir}${SL}getwd.obj \
       ${lib_dir}${SL}savecwd.obj \
       ${lib_dir}${SL}sighandle.obj \
       ${lib_dir}${SL}yesno.obj \
       ${lib_dir}${SL}vasprintf.obj \
       ${lib_dir}${SL}xgetwd.obj \
       ${lib_dir}${SL}md5.obj \
       ${lib_dir}${SL}fnmatch.obj \
       ${lib_dir}${SL}regex.obj \
       ${lib_dir}/valloc.obj

ZLIB_OBJECTS = ${zlib_dir}/adler32.obj \
       ${zlib_dir}/compress.obj \
       ${zlib_dir}/crc32.obj \
       ${zlib_dir}/uncompr.obj \
       ${zlib_dir}/deflate.obj \
       ${zlib_dir}/trees.obj \
       ${zlib_dir}/zutil.obj \
       ${zlib_dir}/inflate.obj \
       ${zlib_dir}/infblock.obj \
       ${zlib_dir}/inftrees.obj \
       ${zlib_dir}/infcodes.obj \
       ${zlib_dir}/infutil.obj \
       ${zlib_dir}/inffast.obj

SOURCES = ${COMMON_SOURCES} ${LIB_SOURCES} ${OS2_SOURCES}
HEADERS = ${COMMON_HEADERS} ${OS2_HEADERS}
OBJECTS = ${COMMON_OBJECTS} ${LIB_OBJECTS} ${OS2_OBJECTS} ${ZLIB_OBJECTS}

DISTFILES = ${OS2_HEADERS} ${OS2_SOURCES} \
  README ChangeLog \
  Makefile.in .cvsignore \
  test-makefile Makefile os2inc.h \
  watcom.mak

all:

.PHONY: all install uninstall
all install uninstall:

# Remove targets for Automake
dvi info pdf ps:
.PHONY: dvi info pdf ps
check installcheck:
.PHONY: check installcheck
installdirs:
lint:
tags TAGS:
.PHONY: installdirs lint tags TAGS

# distdir added for compatibility with CVS automake.
top_distdir = ..
PACKAGE = @PACKAGE@
VERSION = @VERSION@
distdir = $(top_distdir)/$(PACKAGE)-$(VERSION)

distdir: $(DISTFILES)
	@list='$(DISTFILES)'; for file in $$list; do \
	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
	    dir="/$$dir"; \
	    $(mkinstalldirs) "$(distdir)$$dir"; \
	  else \
	    dir=''; \
	  fi; \
	  if test -d $$d/$$file; then \
	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
	    fi; \
	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
	  else \
	    test -f $(distdir)/$$file \
	    || cp -p $$d/$$file $(distdir)/$$file \
	    || exit 1; \
	  fi; \
	done
.PHONY: distdir

# We don't have a real distclean or anything like that, but at least
# we can get rid of the obj files and cvs.exe. 
.PHONY: clean distclean realclean mostlyclean maintainer-clean
clean distclean realclean maintainer-clean mostlyclean:
	rm -f cvs.exe
	rm -f ${srcdir}${SL}*.obj 
	rm -f ${lib_dir}${SL}*.obj 
	rm -f ${cvs_srcdir}${SL}*.obj 

install-cvs: cvs.exe
	cp ${srcdir}${SL}cvs.exe ${install_dir}${SL}cvs.exe

%.obj: %.c
	icc ${OBJ_CFLAGS} ${CFLAGS} /Fo$@ $*.c

# There seems to be no ICC option for specifying library locations, so
# we must `set' the path in the compilation environment.  Urgkle. 
#
#         I'm having some weird problem with "\" vs. "/".  If I build
# with "\" as the path separator in the makefile, the compiler dumps
# core.  Go figure.  If I build with "/" as the path separator, the
# object files compile fine but the linker thinks the "/" is indicating
# options and gets all confused (though at least it doesn't dump core).
# So, use subst to compile with "/" and link with "\".
cvs.exe: ${OBJECTS}
	echo Creating icc.in...
	echo -Q+ -Ti+ -Fe$@ -B"/batch" -B"/NOE" > icc.in
	echo $(subst /,\,$(OS2_OBJECTS))       >> icc.in
	echo $(subst /,\,$(LIB_OBJECTS))       >> icc.in
	echo $(subst /,\,$(COMMON_OBJECTS))    >> icc.in
	echo $(subst /,\,$(ZLIB_OBJECTS))      >> icc.in
	echo $(subst /,\,$(TCPIPLIB))          >> icc.in
	echo $(subst /,\,$(ARGVLIB))           >> icc.in
	echo Creating icc.in... done.
	set LIB=$(subst /,\,$(LIB)) & icc @icc.in

# cvs.obj: ${OBJECTS} ${SOURCES} ${HEADERS}

# Hmm.  This rule wants to exist on unix, so that "make dist" works.
# And it doesn't want to exist on OS/2, because configure doesn't
# run on OS/2 and so ../config.status won't exist.  For now we just
# say, in emx/README, that people will need to comment it out.
Makefile: ../config.status $(srcdir)/Makefile.in
	cd .. && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= ./config.status