File: create.mk.xae

package info (click to toggle)
aee 2.2.15b-3
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k, lenny
  • size: 812 kB
  • ctags: 1,656
  • sloc: ansic: 17,475; sh: 504; makefile: 64
file content (248 lines) | stat: -rwxr-xr-x 4,585 bytes parent folder | download | duplicates (3)
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
#!/bin/sh

#
#	This script will determine if the system is a System V or BSD based
#	UNIX system and create a makefile for xae appropriate for the system.
#
# $Header: /home/hugh/sources/aee/RCS/create.mk.xae,v 1.11 2002/09/23 04:16:09 hugh Exp hugh $
#

other_cflags=""

HEADER_FILES=""

# if HP-UX, add other CFLAGS

name_string="`uname`"

if [ "$name_string" = "HP-UX" ]
then
	other_cflags="$other_cflags -Wa,-Ns10000 -Aa -D_HPUX_SOURCE"
fi

if [ "$name_string" = "Darwin" ]
then
	strip_option=""
	other_cflags="-DNO_CATGETS"
else
	strip_option="-s"
fi

# check for stdlib.h

if [ -f /usr/include/stdlib.h ]
then
	HAS_STDLIB=-DHAS_STDLIB
else
	HAS_STDLIB=""
fi

# check for stdarg.h

if [ -f /usr/include/stdarg.h ]
then
	HAS_STDARG=-DHAS_STDARG
else
	HAS_STDARG=""
fi

# check for unistd.h

if [ -f /usr/include/unistd.h ]
then
	HAS_UNISTD=-DHAS_UNISTD
else
	HAS_UNISTD=""
fi

# check for ctype.h

if [ -f /usr/include/ctype.h ]
then
	HAS_CTYPE=-DHAS_CTYPE
else
	HAS_CTYPE=""
fi

# check for sys/ioctl.h

if [ -f /usr/include/sys/ioctl.h ]
then
	HAS_SYS_IOCTL=-DHAS_SYS_IOCTL
else
	HAS_SYS_IOCTL=""
fi

# check for sys/wait.h

if [ -f /usr/include/sys/wait.h ]
then
        HAS_SYS_WAIT=-DHAS_SYS_WAIT
else
        HAS_SYS_WAIT=""
fi

# check for localization headers

if [ -f /usr/include/locale.h -a -f /usr/include/nl_types.h ]
then
	catgets=""
else
	catgets="-DNO_CATGETS"
fi

# check if this is a SunOS system

if [ -d /usr/5include ]
then
	five_include="-I/usr/5include"
else
	five_include=""
fi

if [ -d /usr/5lib ]
then
	five_lib="-L/usr/5lib"
else
	five_lib=""
fi

# check location of X11 headers

X_headers=""

if [ -d /usr/include/X11R5 ]
then
	X_headers="-I/usr/include/X11R5"
fi

if [ -d /usr/include/X11R6 ]
then
	X_headers="-I/usr/include/X11R6"
fi

if [ -d /usr/X11R6/include ]
then
	X_headers="-I/usr/X11R6/include"
fi

if [ -d /usr/openwin/include ]
then
	X_headers="${X_headers} -I/usr/openwin/include"
fi

# check location of X11 libraries

X_libs=""

if [ -d /usr/lib/X11R5 ]
then
	X_libs="-L/usr/lib/X11R5"
fi

if [ -d /usr/lib/X11R6 ]
then
	X_libs="-L/usr/lib/X11R6"
fi

if [ -d /usr/X11R6/lib ]
then
	X_libs="${X_libs} -L/usr/X11R6/lib"
fi

if [ -d /usr/openwin/lib ]
then
	X_libs="${X_libs} -L/usr/openwin/lib"
fi

if [ -n "$CFLAGS" ]
then
	if [ -z "`echo $CFLAGS | grep '[-]g'`" ]
	then
		other_cflags="$other_cflags ${CFLAGS} ${strip_option}"
	else
		other_cflags="$other_cflags ${CFLAGS}"
	fi
else
	other_cflags="$other_cflags ${strip_option}"
fi

# make xae_dir subdirectory exists

if [ ! -d xae_dir ]
then
	mkdir xae_dir
fi

# time to write the makefile

echo "Generating xae_dir/make.xae"

if [ -f xae_dir/make.xae ]
then
	mv xae_dir/make.xae xae_dir/make.xae.old
fi

echo "DEFINES =	-DXAE -Dxae11 $catgets " > xae_dir/make.xae
echo "" >> xae_dir/make.xae
echo "CFLAGS =	$HAS_UNISTD $HAS_STDARG $HAS_STDLIB $HAS_CTYPE $HAS_SYS_IOCTL $HAS_SYS_WAIT $X_headers $five_include $X_libs $five_lib $other_cflags" >> xae_dir/make.xae
echo "" >> xae_dir/make.xae
echo "" >> xae_dir/make.xae
echo "all :	xae" >> xae_dir/make.xae

cat  >> xae_dir/make.xae << EOF

CC_CMD = cc \$(DEFINES) -I.. -c \$(CFLAGS)

OBJS = aee.o control.o format.o localize.o srch_rep.o delete.o mark.o motion.o keys.o help.o windows.o journal.o file.o

xae :	\$(OBJS) Xcurse.o xif.o
	cc -o ../xae \$(OBJS) Xcurse.o xif.o \$(CFLAGS) -lX11



Xcurse.o: ../Xcurse.c ../aee.h ../Xcurse.h
	\${CC_CMD} ../Xcurse.c 
aee.o: ../aee.c ../aee.h ../Xcurse.h
	\${CC_CMD} ../aee.c
control.o: ../control.c ../aee.h ../Xcurse.h
	\${CC_CMD} ../control.c
delete.o: ../delete.c ../aee.h ../Xcurse.h
	\${CC_CMD} ../delete.c
format.o: ../format.c ../aee.h ../Xcurse.h
	\${CC_CMD} ../format.c
help.o: ../help.c ../aee.h ../Xcurse.h
	\${CC_CMD} ../help.c
journal.o: ../journal.c ../aee.h ../Xcurse.h
	\${CC_CMD} ../journal.c
file.o: ../file.c ../aee.h ../Xcurse.h
	\${CC_CMD} ../file.c
keys.o: ../keys.c ../aee.h ../Xcurse.h
	\${CC_CMD} ../keys.c
localize.o: ../localize.c ../aee.h ../Xcurse.h
	\${CC_CMD} ../localize.c
mark.o: ../mark.c ../aee.h ../Xcurse.h
	\${CC_CMD} ../mark.c
motion.o: ../motion.c ../aee.h ../Xcurse.h
	\${CC_CMD} ../motion.c
new_curse.o: ../new_curse.c ../aee.h ../Xcurse.h
	\${CC_CMD} ../new_curse.c
srch_rep.o: ../srch_rep.c ../aee.h ../Xcurse.h
	\${CC_CMD} ../srch_rep.c
windows.o: ../windows.c ../aee.h ../Xcurse.h
	\${CC_CMD} ../windows.c
xif.o: ../xif.c ../aee.h ../Xcurse.h
	\${CC_CMD} ../xif.c
EOF

if [ -f xae_dir/make.xae.old ]
then
	diffs="`cmp xae_dir/make.xae.old xae_dir/make.xae`"
	if [ -n "${diffs}" ]
	then
		rm -f xae_dir/*.o xae
	fi
	rm -f xae_dir/make.xae.old
fi