Build system: Move install definitions to include
[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 include @TOP_OBJDIR@/src/config/Makefile.lwp
13
14
15 INCLS=gtxobjects.h \
16         gtxwindows.h \
17         gtxcurseswin.h \
18         gtxinput.h \
19         gtxdumbwin.h \
20         gtxX11win.h \
21         gtxobjects.h \
22         gtxkeymap.h \
23         gtxlightobj.h \
24         gtxtextobj.h \
25         gtxframe.h \
26         gtxobjdict.h \
27         ${TOP_INCDIR}/afs/keys.h \
28         ${TOP_INCDIR}/afs/cellconfig.h \
29         ${TOP_INCDIR}/afs/cmd.h
30
31 LIBS=\
32         ${TOP_LIBDIR}/librx.a \
33         ${TOP_LIBDIR}/liblwp.a \
34         ${TOP_LIBDIR}/libsys.a \
35         ${TOP_LIBDIR}/libcmd.a \
36         ${TOP_LIBDIR}/libkauth.a \
37         ${TOP_LIBDIR}/libauth.a \
38         ${TOP_LIBDIR}/librxkad.a \
39         ${TOP_LIBDIR}/libafscom_err.a \
40         ${TOP_LIBDIR}/util.a
41
42 EXTRA_LIBS=${LIB_curses} ${XLIBS}
43
44 KEYMAP_SRCS=keymap.c input.c frame.c
45
46 KEYMAP_OBJS=keymap.o input.o frame.o
47
48 WINDOW_SRCS=curseswindows.c \
49         dumbwindows.c \
50         X11windows.c \
51         windows.c
52
53 WINDOW_OBJS=curseswindows.o \
54         dumbwindows.o \
55         X11windows.o \
56         windows.o
57
58 OBJECT_SRCS=objects.c \
59         lightobject.c \
60         textobject.c
61
62 OBJECT_OBJS=objects.o \
63         lightobject.o \
64         textobject.o
65
66 DICT_SRCS=objdict.c
67 DICT_OBJS=objdict.o
68
69 CB_SRCS=textcb.c
70 CB_OBJS=textcb.o
71
72 all: gtxtest \
73         ${TOP_LIBDIR}/libgtx.a \
74         ${TOP_INCDIR}/afs/gtxcurseswin.h \
75         ${TOP_INCDIR}/afs/gtxdumbwin.h \
76         ${TOP_INCDIR}/afs/gtxframe.h \
77         ${TOP_INCDIR}/afs/gtxinput.h \
78         ${TOP_INCDIR}/afs/gtxkeymap.h \
79         ${TOP_INCDIR}/afs/gtxlightobj.h \
80         ${TOP_INCDIR}/afs/gtxobjdict.h \
81         ${TOP_INCDIR}/afs/gtxobjects.h \
82         ${TOP_INCDIR}/afs/gtxtextcb.h \
83         ${TOP_INCDIR}/afs/gtxtextobj.h \
84         ${TOP_INCDIR}/afs/gtxwindows.h \
85         ${TOP_INCDIR}/afs/gtxX11win.h
86
87 ${TOP_LIBDIR}/libgtx.a: libgtx.a
88         ${INSTALL_DATA} $? $@
89
90 ${TOP_INCDIR}/afs/gtxcurseswin.h: gtxcurseswin.h
91         ${INSTALL_DATA} $? $@
92
93 ${TOP_INCDIR}/afs/gtxdumbwin.h: gtxdumbwin.h
94         ${INSTALL_DATA} $? $@
95
96 ${TOP_INCDIR}/afs/gtxframe.h: gtxframe.h
97         ${INSTALL_DATA} $? $@
98
99 ${TOP_INCDIR}/afs/gtxinput.h: gtxinput.h
100         ${INSTALL_DATA} $? $@
101
102 ${TOP_INCDIR}/afs/gtxkeymap.h: gtxkeymap.h
103         ${INSTALL_DATA} $? $@
104
105 ${TOP_INCDIR}/afs/gtxlightobj.h: gtxlightobj.h
106         ${INSTALL_DATA} $? $@
107
108 ${TOP_INCDIR}/afs/gtxobjdict.h: gtxobjdict.h
109         ${INSTALL_DATA} $? $@
110
111 ${TOP_INCDIR}/afs/gtxobjects.h: gtxobjects.h
112         ${INSTALL_DATA} $? $@
113
114 ${TOP_INCDIR}/afs/gtxtextcb.h: gtxtextcb.h
115         ${INSTALL_DATA} $? $@
116
117 ${TOP_INCDIR}/afs/gtxtextobj.h: gtxtextobj.h
118         ${INSTALL_DATA} $? $@
119
120 ${TOP_INCDIR}/afs/gtxwindows.h: gtxwindows.h
121         ${INSTALL_DATA} $? $@
122
123 ${TOP_INCDIR}/afs/gtxX11win.h: gtxX11win.h
124         ${INSTALL_DATA} $? $@
125
126 tests: object_test screen_test curses_test cb_test gtxtest
127
128 # All objects in the library
129 LIBSRCS = ${KEYMAP_SRCS} ${WINDOW_SRCS} ${OBJECT_SRCS} ${DICT_SRCS} ${CB_SRCS}
130 LIBOBJS = $(KEYMAP_OBJS) ${WINDOW_OBJS} ${OBJECT_OBJS} ${DICT_OBJS} ${CB_OBJS}
131
132 ${LIBSRCS}: ${INCLS}
133 $(LIBOBJS): ${INCLS}
134
135 keymap.o: keymap.c ${INCLS}
136
137 frame.o: frame.c $(INCLS)
138
139 input.o: input.c ${INCLS}
140
141 curseswindows.o: curseswindows.c ${INCLS}
142
143 dumbwindows.o: dumbwindows.c ${INCLS}
144
145 X11windows.o: X11windows.c ${INCLS}
146
147 windows.o: windows.c ${INCLS}
148
149 lightobject.o: lightobject.c ${INCLS}
150
151 textobject.o: textobject.c ${INCLS}
152
153 textcb.o: textcb.c ${INCLS}
154
155 #
156 # Test programs.
157 #
158 curses_test.o: curses_test.c ${INCLS} AFS_component_version_number.o
159
160 curses_test: curses_test.o $(LIBS)
161         $(AFS_LDRULE) curses_test.o $(LIBS) ${EXTRA_LIBS}
162
163 screen_test.o: screen_test.c ${INCLS} AFS_component_version_number.o
164
165 screen_test: screen_test.o ${WINDOW_OBJS} ${LIBS}
166         $(AFS_LDRULE) screen_test.o ${WINDOW_OBJS} ${LIBS} ${EXTRA_LIBS}
167
168 cb_test.o: cb_test.c ${INCLS} AFS_component_version_number.o
169
170 cb_test: cb_test.o ${CB_OBJS} ${LIBS}
171         $(AFS_LDRULE) cb_test.o ${CB_OBJS} ${LIBS} ${EXTRA_LIBS}
172
173 gtxtest.o: gtxtest.c ${INCLS} AFS_component_version_number.o
174
175 gtxtest: gtxtest.o libgtx.a ${LIBS}
176         $(AFS_LDRULE) gtxtest.o libgtx.a ${LIBS} ${EXTRA_LIBS}
177
178 object_test.o: object_test.c ${INCLS} AFS_component_version_number.o
179
180 object_test: object_test.o ${WINDOW_OBJS} ${DICT_OBJS} ${OBJECT_OBJS} ${CB_OBJS} ${LIBS}
181         $(AFS_LDRULE) object_test.o ${WINDOW_OBJS} ${DICT_OBJS} \
182                 ${OBJECT_OBJS} ${CB_OBJS} ${LIBS} ${EXTRA_LIBS}
183
184 #
185 # Installation targets
186 #
187 libgtx.a: ${LIBOBJS} AFS_component_version_number.o
188         -$(RM) -f $@
189         $(AR) crv $@ ${LIBOBJS} AFS_component_version_number.o
190         ${RANLIB} $@
191
192 install: libgtx.a
193         ${INSTALL} -d ${DESTDIR}${libdir}/afs
194         ${INSTALL} -d ${DESTDIR}${includedir}/afs
195         ${INSTALL_DATA} libgtx.a ${DESTDIR}${libdir}/afs/libgtx.a
196         ${INSTALL_DATA} ${srcdir}/gtxcurseswin.h ${DESTDIR}${includedir}/afs/gtxcurseswin.h
197         ${INSTALL_DATA} ${srcdir}/gtxdumbwin.h ${DESTDIR}${includedir}/afs/gtxdumbwin.h
198         ${INSTALL_DATA} ${srcdir}/gtxframe.h ${DESTDIR}${includedir}/afs/gtxframe.h
199         ${INSTALL_DATA} ${srcdir}/gtxinput.h ${DESTDIR}${includedir}/afs/gtxinput.h
200         ${INSTALL_DATA} ${srcdir}/gtxkeymap.h ${DESTDIR}${includedir}/afs/gtxkeymap.h
201         ${INSTALL_DATA} ${srcdir}/gtxlightobj.h ${DESTDIR}${includedir}/afs/gtxlightobj.h
202         ${INSTALL_DATA} ${srcdir}/gtxobjdict.h ${DESTDIR}${includedir}/afs/gtxobjdict.h
203         ${INSTALL_DATA} ${srcdir}/gtxobjects.h ${DESTDIR}${includedir}/afs/gtxobjects.h
204         ${INSTALL_DATA} ${srcdir}/gtxtextcb.h ${DESTDIR}${includedir}/afs/gtxtextcb.h
205         ${INSTALL_DATA} ${srcdir}/gtxtextobj.h ${DESTDIR}${includedir}/afs/gtxtextobj.h
206         ${INSTALL_DATA} ${srcdir}/gtxwindows.h ${DESTDIR}${includedir}/afs/gtxwindows.h
207         ${INSTALL_DATA} ${srcdir}/gtxX11win.h ${DESTDIR}${includedir}/afs/gtxX11win.h
208
209 dest: libgtx.a
210         ${INSTALL} -d ${DEST}/lib/afs
211         ${INSTALL} -d ${DEST}/include/afs
212         ${INSTALL_DATA} libgtx.a ${DEST}/lib/afs/libgtx.a
213         ${INSTALL_DATA} ${srcdir}/gtxcurseswin.h ${DEST}/include/afs/gtxcurseswin.h
214         ${INSTALL_DATA} ${srcdir}/gtxdumbwin.h ${DEST}/include/afs/gtxdumbwin.h
215         ${INSTALL_DATA} ${srcdir}/gtxframe.h ${DEST}/include/afs/gtxframe.h
216         ${INSTALL_DATA} ${srcdir}/gtxinput.h ${DEST}/include/afs/gtxinput.h
217         ${INSTALL_DATA} ${srcdir}/gtxkeymap.h ${DEST}/include/afs/gtxkeymap.h
218         ${INSTALL_DATA} ${srcdir}/gtxlightobj.h ${DEST}/include/afs/gtxlightobj.h
219         ${INSTALL_DATA} ${srcdir}/gtxobjdict.h ${DEST}/include/afs/gtxobjdict.h
220         ${INSTALL_DATA} ${srcdir}/gtxobjects.h ${DEST}/include/afs/gtxobjects.h
221         ${INSTALL_DATA} ${srcdir}/gtxtextcb.h ${DEST}/include/afs/gtxtextcb.h
222         ${INSTALL_DATA} ${srcdir}/gtxtextobj.h ${DEST}/include/afs/gtxtextobj.h
223         ${INSTALL_DATA} ${srcdir}/gtxwindows.h ${DEST}/include/afs/gtxwindows.h
224         ${INSTALL_DATA} ${srcdir}/gtxX11win.h ${DEST}/include/afs/gtxX11win.h
225
226 #
227 # Misc targets
228 #
229 clean:
230         $(RM) -f  *.o *.a *.ln object_test screen_test curses_test core cb_test gtxtest AFS_component_version_number.c
231
232 include ../config/Makefile.version