summaryrefslogtreecommitdiff
path: root/src/tet3/makefile.old
blob: cd1624359d0a5c3c7e1e640e582e56dd9bc412f9 (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
#
#      SCCS:  @(#)makefile	1.15 (98/09/01) 
#
#	UniSoft Ltd., London, England
#
# (C) Copyright 1992 X/Open Company Limited
#
# All rights reserved.  No part of this source code may be reproduced,
# stored in a retrieval system, or transmitted, in any form or by any
# means, electronic, mechanical, photocopying, recording or otherwise,
# except as stated in the end-user licence agreement, without the prior
# permission of the copyright owners.
#
# X/Open and the 'X' symbol are trademarks of X/Open Company Limited in
# the UK and other countries.
#
#
# ************************************************************************
#
# SCCS:   	@(#)makefile	1.15 98/09/01 TETware release 3.3
# NAME:		makefile
# PRODUCT:	TETware
# AUTHOR:	Andrew Dingwall, UniSoft Ltd.
# DATE CREATED:	June 1992
#
# DESCRIPTION:
#	TETware makefile
# 
# MODIFICATIONS:
#	Denis McConalogue, UniSoft Limited, September 1993
#	specify transport library via "include" 
# 
#	Denis McConalogue, UniSoft Limited, September 1993
#	added ../xpg3sh/api to list of DIRS
# 
#	Denis McConalogue, UniSoft Limited, October 1993
#	change references to tet2 to dtet2
# 
#	Andrew Dingwall, UniSoft Limited, January 1994
#	added "first makefile rule" to overcome problems with makes
#	that want to make ALL the targets listed on the first rule line
# 
#	Geoff Clare, UniSoft Ltd., August 1996
#	Changes for TETWare.
#
#	Geoff Clare, UniSoft Ltd., Sept 1996
#	Changes for TETWare-Lite.
#
#	Geoff Clare, UniSoft Ltd., Oct 1996
#	Moved generic part of DIRS to here from *lib.mk
#	Moved tcm to the front of DIRS (it puts files in libapi)
#	Moved tcmthr likewise, and added tcmthr(C++).
#
#	Andrew Dingwall, UniSoft Ltd., October 1996
#	added tcclib
#
#	Andrew Dingwall, UniSoft Ltd., July 1998
#	added support for shared libraries
#
# ************************************************************************

include ../defines.mk
include common.mk
include ts.mk

# the order of the library source directories is intended to produce
# optimal member ordering in libapi.a

DIRS = tcm apilib $(TS_LIBDIRS) dtet2lib tcclib tcc $(TS_BINDIRS)
THRDIRS = tcmthr apithr

# for the *SHLIBDIRS, we make the api library before the tcm library
# because on win32 systems making the api library generates a file
# (dynlink.gen) that is needed by the tcm library
SHLIBDIRS = apishlib tcmshlib
THRSHLIBDIRS = apithrshlib tcmthrshlib

first_make_rule: all

# there follows a large in-line shell script
# remember that all shell commands need to be terminated by a ';'

all install CLEAN clean:
	@case $$MAKEFLAGS in						\
	*k*)								\
		set +e;							\
		;;							\
	esac;								\
									\
	: "tcm, api library and programs";				\
	for i in $(DIRS);						\
	do								\
		echo $$i:;						\
		(cd $$i && $(MAKE) $@);					\
	done;								\
									\
	: "thread-safe tcm and api library";				\
	case "$(THR_COPTS)" in						\
	*NOT_SUPPORTED*)						\
		;;							\
	*)								\
		for i in $(THRDIRS);					\
		do							\
			echo $$i:;					\
			(cd $$i && $(MAKE) $@);				\
		done;							\
	esac;								\
									\
	: "shared tcm and api libraries (not win32)";			\
	case "$(SHLIB_COPTS):`uname -s`" in				\
	*NOT_SUPPORTED*|*:Windows_NT|*:Windows_95|*:DOS)		\
		;;							\
	*)								\
		for i in $(SHLIBDIRS);					\
		do							\
			echo $$i:;					\
			(cd $$i && $(MAKE) $@);				\
		done;							\
	esac;								\
									\
	: "thread-safe shared tcm and api libraries";			\
	case "$(SHLIB_COPTS)$(THR_COPTS)" in				\
	*NOT_SUPPORTED*)						\
		;;							\
	*)								\
		for i in $(THRSHLIBDIRS);				\
		do							\
			echo $$i:;					\
			(cd $$i && $(MAKE) $@);				\
		done;							\
	esac;								\
									\
	: "C++ tcm";							\
	case "$(C_PLUS):$@" in						\
	*NOT_SUPPORTED*)						\
		;;							\
	*:all)								\
		echo "tcm(C++):";					\
		(cd tcm && $(MAKE) allC);				\
		;;							\
	*:install)							\
		echo "tcm(C++):";					\
		(cd tcm && $(MAKE) installC);				\
		;;							\
	esac;								\
									\
	: "C++ thread-safe tcm";					\
	case "$(THR_COPTS)$(C_PLUS):$@"					\
	in *NOT_SUPPORTED*)						\
		;;							\
	*:all)								\
		echo "tcmthr(C++):";					\
		(cd tcmthr && $(MAKE) allC);				\
		;;							\
	*:install)							\
		echo "tcmthr(C++):";					\
		(cd tcmthr && $(MAKE) installC);			\
		;;							\
	esac;								\
									\
	: "C++ shared tcm (not win32)";					\
	case "$(SHLIB_COPTS)$(C_PLUS):`uname -s`:$@" in			\
	*NOT_SUPPORTED*|*:Windows_NT:*|*:Windows_95:*|*:DOS:*)		\
		;;							\
	*:all)								\
		echo "tcmshlib(C++):";					\
		(cd tcmshlib && $(MAKE) allC);				\
		;;							\
	*:install)							\
		echo "tcmshlib(C++):";					\
		(cd tcmshlib && $(MAKE) installC);			\
		;;							\
	esac;								\
									\
	: "C++ thread-safe shared tcm";					\
	case "$(THR_COPTS)$(SHLIB_COPTS)$(C_PLUS):$@" in		\
	*NOT_SUPPORTED*)						\
		;;							\
	*:all)								\
		echo "tcmthrshlib(C++):";				\
		(cd tcmthrshlib && $(MAKE) allC);			\
		;;							\
	*:install)							\
		echo "tcmsthrhlib(C++):";				\
		(cd tcmthrshlib && $(MAKE) installC);			\
		;;							\
	esac;


# below are two rules: the first line and then the multi-line script

CLOBBER clobber FORCE FRC:
	@set $(DIRS); set -x; cd $$1; rm -f $(LIBDAPI) $(LIBTHRAPI)
	@case $$MAKEFLAGS in						\
	*k*)								\
		set +e;							\
		;;							\
	esac;								\
	for i in $(DIRS) $(THRDIRS) $(SHLIBDIRS) $(THRSHLIBDIRS);	\
	do								\
		echo $$i:;						\
		(cd $$i && $(MAKE) $@);					\
	done;