xref: /openbsd/gnu/usr.bin/cvs/os2/Makefile.in (revision 76d0caae)
1# Makefile for OS/2.  Generated from Makefile.in when CVS is
2# configured for a dist-build.  Configure never gets run on OS/2, so
3# we must include the generated Makefile in the distribution.  See the
4# `dist-dir' rule.
5
6project: cvs.exe
7# .SUFFIXES .c .obj .exe
8
9# path slash.  This was introduced so that it can be set to \
10# instead of / for linking, but now that the cvs.exe rule uses
11# subst to produce \, it should be possible to nuke SL.
12# FIXME - nuke SL
13SL = /
14
15# Directory in which to install executables.
16install_dir = s:${SL}gnu${SL}util
17
18# srcdir is usually "."
19srcdir     = @srcdir@
20
21# top_srcdir is usually ".."
22top_srcdir = @top_srcdir@
23
24VPATH      = @srcdir@
25subdir     = os2
26
27lib_dir     = @top_srcdir@${SL}lib
28cvs_srcdir = @top_srcdir@${SL}src
29
30zlib_dir = ${top_srcdir}/zlib
31
32# Do we need these?
33# prefix = /usr/local
34# exec_prefix = ${prefix}
35
36# taken straight from the example project
37LIB = s:${SL}ibmcpp${SL}lib;s:${SL}toolkt21${SL}os2lib;
38CINC = -Is:${SL}ibmcpp${SL}include -Is:${SL}toolkt21${SL}c${SL}os2h
39# This says we are building an object file, not a full executable.
40OBJ_CFLAGS = -C+
41CFLAGS = -W3 -Wrea+tru+ -Ti+ -Ss+ -Gd- -Gm+ -G4 -Q+ -Sm ${CINC} \
42  -I${srcdir} -I${lib_dir} -I${cvs_srcdir} -I${zlib_dir} \
43  -DIBM_CPP -DHAVE_CONFIG_H \
44  -DTCPIP_IBM -Is:${SL}ibmtcpip${SL}include
45
46# needed to make command-line wildcard expansion work right.  That's
47# right, DOS-descendants handle this from the program, not the shell.
48ARGVLIB = s:${SL}ibmcpp${SL}lib${SL}setargv.obj
49
50# TCP/IP stuff
51TCPIPLIB = s:${SL}ibmtcpip${SL}lib${SL}tcp32dll.lib	s:${SL}ibmtcpip${SL}lib${SL}so32dll.lib
52
53
54# headers specific to OS/2
55
56# We list OS2_HEADERS so we know what to include when we make dist-dir
57# here.
58OS2_HEADERS = \
59       ${srcdir}${SL}tcpip.h \
60       ${srcdir}${SL}config.h \
61       ${srcdir}${SL}options.h \
62       ${srcdir}${SL}pwd.h \
63       ${srcdir}${SL}dirent.h \
64       ${srcdir}${SL}rcmd.h \
65       ${srcdir}${SL}popen.h
66
67# headers we use from the common src dir, ..${SL}src
68COMMON_HEADERS = \
69       ${cvs_srcdir}${SL}client.h \
70       ${cvs_srcdir}${SL}cvs.h \
71       ${cvs_srcdir}${SL}rcs.h \
72       ${cvs_srcdir}${SL}hash.h \
73       ${cvs_srcdir}${SL}myndbm.h \
74       ${cvs_srcdir}${SL}patchlevel.h \
75       ${cvs_srcdir}${SL}update.h \
76       ${cvs_srcdir}${SL}server.h \
77       ${cvs_srcdir}${SL}error.h
78
79# sources specific to OS/2
80OS2_SOURCES = \
81       ${srcdir}${SL}mkdir.c \
82       ${srcdir}${SL}pwd.c \
83       ${srcdir}${SL}filesubr.c \
84       ${srcdir}${SL}dirent.c \
85       ${srcdir}${SL}run.c \
86       ${srcdir}${SL}stripslash.c \
87       ${srcdir}${SL}rcmd.c \
88       ${srcdir}${SL}waitpid.c \
89       ${srcdir}${SL}popen.c \
90       ${srcdir}${SL}porttcp.c \
91       ${srcdir}${SL}getpass.c
92
93# sources we use from the common src dir, ..${SL}src
94# FIXME: Is this used anywhere?  I don't think it is.
95COMMON_SOURCES = \
96       ${cvs_srcdir}${SL}add.c \
97       ${cvs_srcdir}${SL}admin.c \
98       ${cvs_srcdir}${SL}buffer.c \
99       ${cvs_srcdir}${SL}checkin.c \
100       ${cvs_srcdir}${SL}checkout.c \
101       ${cvs_srcdir}${SL}classify.c \
102       ${cvs_srcdir}${SL}client.c \
103       ${cvs_srcdir}${SL}commit.c \
104       ${cvs_srcdir}${SL}create_adm.c \
105       ${cvs_srcdir}${SL}cvsrc.c \
106       ${cvs_srcdir}${SL}diff.c \
107       ${cvs_srcdir}${SL}edit.c \
108       ${cvs_srcdir}${SL}entries.c \
109       ${cvs_srcdir}${SL}error.c \
110       ${cvs_srcdir}${SL}expand_path.c \
111       ${cvs_srcdir}${SL}fileattr.c \
112       ${cvs_srcdir}${SL}find_names.c \
113       ${cvs_srcdir}${SL}hash.c \
114       ${cvs_srcdir}${SL}history.c \
115       ${cvs_srcdir}${SL}ignore.c \
116       ${cvs_srcdir}${SL}import.c \
117       ${cvs_srcdir}${SL}lock.c \
118       ${cvs_srcdir}${SL}log.c \
119       ${cvs_srcdir}${SL}login.c \
120       ${cvs_srcdir}${SL}logmsg.c \
121       ${cvs_srcdir}${SL}main.c \
122       ${cvs_srcdir}${SL}mkmodules.c \
123       ${cvs_srcdir}${SL}modules.c \
124       ${cvs_srcdir}${SL}myndbm.c \
125       ${cvs_srcdir}${SL}no_diff.c \
126       ${cvs_srcdir}${SL}parseinfo.c \
127       ${cvs_srcdir}${SL}patch.c \
128       ${cvs_srcdir}${SL}rcs.c \
129       ${cvs_srcdir}${SL}rcscmds.c \
130       ${cvs_srcdir}${SL}recurse.c \
131       ${cvs_srcdir}${SL}release.c \
132       ${cvs_srcdir}${SL}remove.c \
133       ${cvs_srcdir}${SL}repos.c \
134       ${cvs_srcdir}${SL}root.c \
135       ${cvs_srcdir}${SL}scramble.c \
136       ${cvs_srcdir}${SL}server.c \
137       ${cvs_srcdir}${SL}status.c \
138       ${cvs_srcdir}${SL}subr.c \
139       ${cvs_srcdir}${SL}tag.c \
140       ${cvs_srcdir}${SL}update.c \
141       ${cvs_srcdir}${SL}watch.c \
142       ${cvs_srcdir}${SL}wrapper.c \
143       ${cvs_srcdir}${SL}vers_ts.c \
144       ${cvs_srcdir}${SL}version.c
145# end of $COMMON_SOURCES
146
147# sources from ..${SL}lib
148# FIXME: Is this used anywhere?  I don't think it is.
149LIB_SOURCES = \
150       ${lib_dir}${SL}getdate.c \
151       ${lib_dir}${SL}getopt.c \
152       ${lib_dir}${SL}getopt1.c \
153       ${lib_dir}${SL}getline.c \
154       ${lib_dir}${SL}getwd.c \
155       ${lib_dir}${SL}savecwd.c \
156       ${lib_dir}${SL}sighandle.c \
157       ${lib_dir}${SL}yesno.c \
158       ${lib_dir}${SL}vasprintf.c \
159       ${lib_dir}${SL}xgetwd.c \
160       ${lib_dir}${SL}md5.c \
161       ${lib_dir}${SL}fnmatch.c \
162       ${lib_dir}${SL}regex.c
163
164# object files from OS/2 sources
165OS2_OBJECTS = \
166       ${srcdir}${SL}mkdir.obj \
167       ${srcdir}${SL}pwd.obj \
168       ${srcdir}${SL}filesubr.obj \
169       ${srcdir}${SL}dirent.obj \
170       ${srcdir}${SL}run.obj \
171       ${srcdir}${SL}stripslash.obj \
172       ${srcdir}${SL}rcmd.obj \
173       ${srcdir}${SL}waitpid.obj \
174       ${srcdir}${SL}popen.obj \
175       ${srcdir}${SL}porttcp.obj \
176       ${srcdir}${SL}getpass.obj
177
178# object files from ..${SL}src
179COMMON_OBJECTS = \
180       ${cvs_srcdir}${SL}add.obj \
181       ${cvs_srcdir}${SL}admin.obj \
182       ${cvs_srcdir}${SL}buffer.obj \
183       ${cvs_srcdir}${SL}checkin.obj \
184       ${cvs_srcdir}${SL}checkout.obj \
185       ${cvs_srcdir}${SL}classify.obj \
186       ${cvs_srcdir}${SL}client.obj \
187       ${cvs_srcdir}${SL}commit.obj \
188       ${cvs_srcdir}${SL}create_adm.obj \
189       ${cvs_srcdir}${SL}cvsrc.obj \
190       ${cvs_srcdir}${SL}diff.obj \
191       ${cvs_srcdir}${SL}edit.obj \
192       ${cvs_srcdir}${SL}entries.obj \
193       ${cvs_srcdir}${SL}error.obj \
194       ${cvs_srcdir}${SL}expand_path.obj \
195       ${cvs_srcdir}${SL}fileattr.obj \
196       ${cvs_srcdir}${SL}find_names.obj \
197       ${cvs_srcdir}${SL}hash.obj \
198       ${cvs_srcdir}${SL}history.obj \
199       ${cvs_srcdir}${SL}ignore.obj \
200       ${cvs_srcdir}${SL}import.obj \
201       ${cvs_srcdir}${SL}lock.obj \
202       ${cvs_srcdir}${SL}log.obj \
203       ${cvs_srcdir}${SL}login.obj \
204       ${cvs_srcdir}${SL}logmsg.obj \
205       ${cvs_srcdir}${SL}main.obj \
206       ${cvs_srcdir}${SL}mkmodules.obj \
207       ${cvs_srcdir}${SL}modules.obj \
208       ${cvs_srcdir}${SL}myndbm.obj \
209       ${cvs_srcdir}${SL}no_diff.obj \
210       ${cvs_srcdir}${SL}parseinfo.obj \
211       ${cvs_srcdir}${SL}patch.obj \
212       ${cvs_srcdir}${SL}rcs.obj \
213       ${cvs_srcdir}${SL}rcscmds.obj \
214       ${cvs_srcdir}${SL}recurse.obj \
215       ${cvs_srcdir}${SL}release.obj \
216       ${cvs_srcdir}${SL}remove.obj \
217       ${cvs_srcdir}${SL}repos.obj \
218       ${cvs_srcdir}${SL}root.obj \
219       ${cvs_srcdir}${SL}scramble.obj \
220       ${cvs_srcdir}${SL}server.obj \
221       ${cvs_srcdir}${SL}status.obj \
222       ${cvs_srcdir}${SL}subr.obj \
223       ${cvs_srcdir}${SL}tag.obj \
224       ${cvs_srcdir}${SL}update.obj \
225       ${cvs_srcdir}${SL}watch.obj \
226       ${cvs_srcdir}${SL}wrapper.obj \
227       ${cvs_srcdir}${SL}vers_ts.obj \
228       ${cvs_srcdir}${SL}version.obj \
229       ${cvs_srcdir}/zlib.obj
230# end of $COMMON_OBJECTS
231
232# objects from ..${SL}lib
233LIB_OBJECTS = \
234       ${lib_dir}${SL}getdate.obj \
235       ${lib_dir}${SL}getopt.obj \
236       ${lib_dir}${SL}getopt1.obj \
237       ${lib_dir}${SL}getline.obj \
238       ${lib_dir}${SL}getwd.obj \
239       ${lib_dir}${SL}savecwd.obj \
240       ${lib_dir}${SL}sighandle.obj \
241       ${lib_dir}${SL}yesno.obj \
242       ${lib_dir}${SL}vasprintf.obj \
243       ${lib_dir}${SL}xgetwd.obj \
244       ${lib_dir}${SL}md5.obj \
245       ${lib_dir}${SL}fnmatch.obj \
246       ${lib_dir}${SL}regex.obj \
247       ${lib_dir}/valloc.obj
248
249ZLIB_OBJECTS = ${zlib_dir}/adler32.obj \
250       ${zlib_dir}/compress.obj \
251       ${zlib_dir}/crc32.obj \
252       ${zlib_dir}/uncompr.obj \
253       ${zlib_dir}/deflate.obj \
254       ${zlib_dir}/trees.obj \
255       ${zlib_dir}/zutil.obj \
256       ${zlib_dir}/inflate.obj \
257       ${zlib_dir}/infblock.obj \
258       ${zlib_dir}/inftrees.obj \
259       ${zlib_dir}/infcodes.obj \
260       ${zlib_dir}/infutil.obj \
261       ${zlib_dir}/inffast.obj
262
263SOURCES = ${COMMON_SOURCES} ${LIB_SOURCES} ${OS2_SOURCES}
264HEADERS = ${COMMON_HEADERS} ${OS2_HEADERS}
265OBJECTS = ${COMMON_OBJECTS} ${LIB_OBJECTS} ${OS2_OBJECTS} ${ZLIB_OBJECTS}
266
267DISTFILES = ${OS2_HEADERS} ${OS2_SOURCES} \
268  ${srcdir}${SL}README ${srcdir}${SL}ChangeLog \
269  ${srcdir}${SL}Makefile.in ${srcdir}${SL}.cvsignore \
270  ${srcdir}${SL}test-makefile Makefile ${srcdir}/os2inc.h \
271  ${srcdir}/watcom.mak
272
273all:
274
275.PHONY: all install uninstall
276all install uninstall:
277
278# Remove targets for Automake
279info:
280.PHONY: info
281
282installcheck:
283.PHONY: installcheck
284
285installdirs:
286.PHONY: installdirs
287
288.PHONY: tags TAGS
289tags TAGS:
290
291.PHONY: lint
292lint:
293
294.PHONY: check
295check:
296
297# distdir added for CVS.
298top_builddir = ..
299PACKAGE = @PACKAGE@
300VERSION = @VERSION@
301distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
302# FIXME - sedding the directory off of the DISTFILES targets is really yucky.
303# The $(srcdir) prefixes should really be removed from all of the files in the
304# lists that make up DISTFILES above.  Unfortunately, I don't have an OS2 box
305# to test on.
306distdir: $(DISTFILES)
307	@d=$(srcdir); \
308	for f in $(DISTFILES); do \
309	  file=`echo $$f |sed 's,.*/,,'`; \
310	  if test -d $(distdir)/`dirname $$file`; then \
311	    :; \
312	  else \
313	    mkdir $(distdir)/`dirname $$file`; \
314	  fi; \
315	  if test -d $$d/$$file; then \
316	    cp -pR $$d/$$file $(distdir) \
317	    || exit 1; \
318	  else \
319	    test -f $(distdir)/$$file \
320	    || cp -p $$d/$$file $(distdir)/$$file \
321	    || exit 1; \
322	  fi; \
323	done
324.PHONY: distdir
325
326# We don't have a real distclean or anything like that, but at least
327# we can get rid of the obj files and cvs.exe.
328.PHONY: clean distclean realclean mostlyclean maintainer-clean
329clean distclean realclean maintainer-clean mostlyclean:
330	rm -f cvs.exe
331	rm -f ${srcdir}${SL}*.obj
332	rm -f ${lib_dir}${SL}*.obj
333	rm -f ${cvs_srcdir}${SL}*.obj
334
335install-cvs: cvs.exe
336	cp ${srcdir}${SL}cvs.exe ${install_dir}${SL}cvs.exe
337
338%.obj: %.c
339	icc ${OBJ_CFLAGS} ${CFLAGS} /Fo$@ $*.c
340
341# There seems to be no ICC option for specifying library locations, so
342# we must `set' the path in the compilation environment.  Urgkle.
343#
344#         I'm having some weird problem with "\" vs. "/".  If I build
345# with "\" as the path separator in the makefile, the compiler dumps
346# core.  Go figure.  If I build with "/" as the path separator, the
347# object files compile fine but the linker thinks the "/" is indicating
348# options and gets all confused (though at least it doesn't dump core).
349# So, use subst to compile with "/" and link with "\".
350cvs.exe: ${OBJECTS}
351	echo Creating icc.in...
352	echo -Q+ -Ti+ -Fe$@ -B"/batch" -B"/NOE" > icc.in
353	echo $(subst /,\,$(OS2_OBJECTS))       >> icc.in
354	echo $(subst /,\,$(LIB_OBJECTS))       >> icc.in
355	echo $(subst /,\,$(COMMON_OBJECTS))    >> icc.in
356	echo $(subst /,\,$(ZLIB_OBJECTS))      >> icc.in
357	echo $(subst /,\,$(TCPIPLIB))          >> icc.in
358	echo $(subst /,\,$(ARGVLIB))           >> icc.in
359	echo Creating icc.in... done.
360	set LIB=$(subst /,\,$(LIB)) & icc @icc.in
361
362# cvs.obj: ${OBJECTS} ${SOURCES} ${HEADERS}
363
364# Hmm.  This rule wants to exist on unix, so that "make dist" works.
365# And it doesn't want to exist on OS/2, because configure doesn't
366# run on OS/2 and so ../config.status won't exist.  For now we just
367# say, in emx/README, that people will need to comment it out.
368Makefile: ../config.status $(srcdir)/Makefile.in
369	cd .. && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= ./config.status
370