Fix objdir install/dest targets
[openafs.git] / src / gtx / Makefile.in
1 # Copyright 2000, International Business Machines Corporation and others.
2 # All Rights Reserved.
3
4 # This software has been released under the terms of the IBM Public
5 # License.  For details, see the LICENSE file in the top-level source
6 # directory or online at http://www.openafs.org/dl/license10.html
7
8 # Makefile for gtx, a display-independent, object-oriented window toolkit.
9
10 srcdir=@srcdir@
11 include @TOP_OBJDIR@/src/config/Makefile.config
12 INSTALL = @INSTALL@
13 INSTALL_DATA = @INSTALL_DATA@
14 INSTALL_PROGRAM = @INSTALL_PROGRAM@
15 INSTALL_SCRIPT = @INSTALL_SCRIPT@
16
17 INCLS=gtxobjects.h \
18         gtxwindows.h \
19         gtxcurseswin.h \
20         gtxinput.h \
21         gtxdumbwin.h \
22         gtxX11win.h \
23         gtxobjects.h \
24         gtxkeymap.h \
25         gtxlightobj.h \
26         gtxtextobj.h \
27         gtxframe.h \
28         gtxobjdict.h \
29         ${TOP_INCDIR}/afs/keys.h \
30         ${TOP_INCDIR}/afs/cellconfig.h \
31         ${TOP_INCDIR}/afs/cmd.h
32
33 LIBS=\
34         ${TOP_LIBDIR}/librx.a \
35         ${TOP_LIBDIR}/liblwp.a \
36         ${TOP_LIBDIR}/libsys.a \
37         ${TOP_LIBDIR}/libcmd.a \
38         ${TOP_LIBDIR}/libkauth.a \
39         ${TOP_LIBDIR}/libauth.a \
40         ${TOP_LIBDIR}/librxkad.a \
41         ${TOP_LIBDIR}/libdes.a \
42         ${TOP_LIBDIR}/libcom_err.a \
43         ${TOP_LIBDIR}/util.a
44
45 EXTRA_LIBS=${TXLIBS} ${XLIBS}
46
47 KEYMAP_SRCS=keymap.c input.c frame.c
48
49 KEYMAP_OBJS=keymap.o input.o frame.o
50
51 WINDOW_SRCS=curseswindows.c \
52         dumbwindows.c \
53         X11windows.c \
54         windows.c
55
56 WINDOW_OBJS=curseswindows.o \
57         dumbwindows.o \
58         X11windows.o \
59         windows.o
60
61 OBJECT_SRCS=objects.c \
62         lightobject.c \
63         textobject.c
64
65 OBJECT_OBJS=objects.o \
66         lightobject.o \
67         textobject.o
68
69 DICT_SRCS=objdict.c
70 DICT_OBJS=objdict.o
71
72 CB_SRCS=textcb.c
73 CB_OBJS=textcb.o
74
75 all: gtxtest \
76         ${TOP_LIBDIR}/libgtx.a \
77         ${TOP_INCDIR}/afs/gtxcurseswin.h \
78         ${TOP_INCDIR}/afs/gtxdumbwin.h \
79         ${TOP_INCDIR}/afs/gtxframe.h \
80         ${TOP_INCDIR}/afs/gtxinput.h \
81         ${TOP_INCDIR}/afs/gtxkeymap.h \
82         ${TOP_INCDIR}/afs/gtxlightobj.h \
83         ${TOP_INCDIR}/afs/gtxobjdict.h \
84         ${TOP_INCDIR}/afs/gtxobjects.h \
85         ${TOP_INCDIR}/afs/gtxtextcb.h \
86         ${TOP_INCDIR}/afs/gtxtextobj.h \
87         ${TOP_INCDIR}/afs/gtxwindows.h \
88         ${TOP_INCDIR}/afs/gtxX11win.h
89
90 ${TOP_LIBDIR}/libgtx.a: libgtx.a
91         ${INSTALL_DATA} $? $@
92
93 ${TOP_INCDIR}/afs/gtxcurseswin.h: gtxcurseswin.h
94         ${INSTALL_DATA} $? $@
95
96 ${TOP_INCDIR}/afs/gtxdumbwin.h: gtxdumbwin.h
97         ${INSTALL_DATA} $? $@
98
99 ${TOP_INCDIR}/afs/gtxframe.h: gtxframe.h
100         ${INSTALL_DATA} $? $@
101
102 ${TOP_INCDIR}/afs/gtxinput.h: gtxinput.h
103         ${INSTALL_DATA} $? $@
104
105 ${TOP_INCDIR}/afs/gtxkeymap.h: gtxkeymap.h
106         ${INSTALL_DATA} $? $@
107
108 ${TOP_INCDIR}/afs/gtxlightobj.h: gtxlightobj.h
109         ${INSTALL_DATA} $? $@
110
111 ${TOP_INCDIR}/afs/gtxobjdict.h: gtxobjdict.h
112         ${INSTALL_DATA} $? $@
113
114 ${TOP_INCDIR}/afs/gtxobjects.h: gtxobjects.h
115         ${INSTALL_DATA} $? $@
116
117 ${TOP_INCDIR}/afs/gtxtextcb.h: gtxtextcb.h
118         ${INSTALL_DATA} $? $@
119
120 ${TOP_INCDIR}/afs/gtxtextobj.h: gtxtextobj.h
121         ${INSTALL_DATA} $? $@
122
123 ${TOP_INCDIR}/afs/gtxwindows.h: gtxwindows.h
124         ${INSTALL_DATA} $? $@
125
126 ${TOP_INCDIR}/afs/gtxX11win.h: gtxX11win.h
127         ${INSTALL_DATA} $? $@
128
129 tests: object_test screen_test curses_test cb_test gtxtest
130
131 # All objects in the library
132 LIBSRCS = ${KEYMAP_SRCS} ${WINDOW_SRCS} ${OBJECT_SRCS} ${DICT_SRCS} ${CB_SRCS}
133 LIBOBJS = $(KEYMAP_OBJS) ${WINDOW_OBJS} ${OBJECT_OBJS} ${DICT_OBJS} ${CB_OBJS}
134
135 ${LIBSRCS}: ${INCLS}
136 $(LIBOBJS): ${INCLS}
137
138 keymap.o: keymap.c ${INCLS}
139
140 frame.o: frame.c $(INCLS)
141
142 input.o: input.c ${INCLS}
143
144 curseswindows.o: curseswindows.c ${INCLS}
145
146 dumbwindows.o: dumbwindows.c ${INCLS}
147
148 X11windows.o: X11windows.c ${INCLS}
149
150 windows.o: windows.c ${INCLS}
151
152 lightobject.o: lightobject.c ${INCLS}
153
154 textobject.o: textobject.c ${INCLS}
155
156 textcb.o: textcb.c ${INCLS}
157
158 #
159 # Test programs.
160 #
161 curses_test.o: curses_test.c ${INCLS} AFS_component_version_number.o
162
163 curses_test: curses_test.o $(LIBS)
164         ${CC} ${CFLAGS} -o curses_test curses_test.o $(LIBS) ${EXTRA_LIBS}
165
166 screen_test.o: screen_test.c ${INCLS} AFS_component_version_number.o
167
168 screen_test: screen_test.o ${WINDOW_OBJS} ${LIBS}
169         ${CC} ${CFLAGS} -o screen_test screen_test.o ${WINDOW_OBJS} ${LIBS} ${EXTRA_LIBS}
170
171 cb_test.o: cb_test.c ${INCLS} AFS_component_version_number.o
172
173 cb_test: cb_test.o ${CB_OBJS} ${LIBS}
174         ${CC} ${CFLAGS} -o cb_test cb_test.o ${CB_OBJS} ${LIBS} ${EXTRA_LIBS}
175
176 gtxtest.o: gtxtest.c ${INCLS} AFS_component_version_number.o
177
178 gtxtest: gtxtest.o libgtx.a ${LIBS}
179         ${CC} ${LDFLAGS} -o gtxtest gtxtest.o libgtx.a ${LIBS} ${EXTRA_LIBS}
180
181 object_test.o: object_test.c ${INCLS} AFS_component_version_number.o
182
183 object_test: object_test.o ${WINDOW_OBJS} ${DICT_OBJS} ${OBJECT_OBJS} ${CB_OBJS} ${LIBS}
184         ${CC} ${CFLAGS} -o object_test object_test.o ${WINDOW_OBJS} ${DICT_OBJS} ${OBJECT_OBJS} ${CB_OBJS} ${LIBS} ${EXTRA_LIBS}
185
186 #
187 # Installation targets
188 #
189 libgtx.a: ${LIBOBJS} AFS_component_version_number.o
190         -$(RM) -f $@
191         $(AR) crv $@ ${LIBOBJS} AFS_component_version_number.o
192         ${RANLIB} $@
193
194 install: libgtx.a
195         ${INSTALL} -d ${DESTDIR}${libdir}/afs
196         ${INSTALL} -d ${DESTDIR}${includedir}/afs
197         ${INSTALL_DATA} libgtx.a ${DESTDIR}${libdir}/afs/libgtx.a
198         ${INSTALL_DATA} ${srcdir}/gtxcurseswin.h ${DESTDIR}${includedir}/afs/gtxcurseswin.h
199         ${INSTALL_DATA} ${srcdir}/gtxdumbwin.h ${DESTDIR}${includedir}/afs/gtxdumbwin.h
200         ${INSTALL_DATA} ${srcdir}/gtxframe.h ${DESTDIR}${includedir}/afs/gtxframe.h
201         ${INSTALL_DATA} ${srcdir}/gtxinput.h ${DESTDIR}${includedir}/afs/gtxinput.h
202         ${INSTALL_DATA} ${srcdir}/gtxkeymap.h ${DESTDIR}${includedir}/afs/gtxkeymap.h
203         ${INSTALL_DATA} ${srcdir}/gtxlightobj.h ${DESTDIR}${includedir}/afs/gtxlightobj.h
204         ${INSTALL_DATA} ${srcdir}/gtxobjdict.h ${DESTDIR}${includedir}/afs/gtxobjdict.h
205         ${INSTALL_DATA} ${srcdir}/gtxobjects.h ${DESTDIR}${includedir}/afs/gtxobjects.h
206         ${INSTALL_DATA} ${srcdir}/gtxtextcb.h ${DESTDIR}${includedir}/afs/gtxtextcb.h
207         ${INSTALL_DATA} ${srcdir}/gtxtextobj.h ${DESTDIR}${includedir}/afs/gtxtextobj.h
208         ${INSTALL_DATA} ${srcdir}/gtxwindows.h ${DESTDIR}${includedir}/afs/gtxwindows.h
209         ${INSTALL_DATA} ${srcdir}/gtxX11win.h ${DESTDIR}${includedir}/afs/gtxX11win.h
210
211 dest: libgtx.a
212         ${INSTALL} -d ${DEST}/lib/afs
213         ${INSTALL} -d ${DEST}/include/afs
214         ${INSTALL_DATA} libgtx.a ${DEST}/lib/afs/libgtx.a
215         ${INSTALL_DATA} ${srcdir}/gtxcurseswin.h ${DEST}/include/afs/gtxcurseswin.h
216         ${INSTALL_DATA} ${srcdir}/gtxdumbwin.h ${DEST}/include/afs/gtxdumbwin.h
217         ${INSTALL_DATA} ${srcdir}/gtxframe.h ${DEST}/include/afs/gtxframe.h
218         ${INSTALL_DATA} ${srcdir}/gtxinput.h ${DEST}/include/afs/gtxinput.h
219         ${INSTALL_DATA} ${srcdir}/gtxkeymap.h ${DEST}/include/afs/gtxkeymap.h
220         ${INSTALL_DATA} ${srcdir}/gtxlightobj.h ${DEST}/include/afs/gtxlightobj.h
221         ${INSTALL_DATA} ${srcdir}/gtxobjdict.h ${DEST}/include/afs/gtxobjdict.h
222         ${INSTALL_DATA} ${srcdir}/gtxobjects.h ${DEST}/include/afs/gtxobjects.h
223         ${INSTALL_DATA} ${srcdir}/gtxtextcb.h ${DEST}/include/afs/gtxtextcb.h
224         ${INSTALL_DATA} ${srcdir}/gtxtextobj.h ${DEST}/include/afs/gtxtextobj.h
225         ${INSTALL_DATA} ${srcdir}/gtxwindows.h ${DEST}/include/afs/gtxwindows.h
226         ${INSTALL_DATA} ${srcdir}/gtxX11win.h ${DEST}/include/afs/gtxX11win.h
227
228 #
229 # Misc targets
230 #
231 clean:
232         $(RM) -f  *.o *.a *.ln object_test screen_test curses_test core cb_test gtxtest AFS_component_version_number.c
233
234 include ../config/Makefile.version