chiark / gitweb /
Import vtwm_5.4.7.orig.tar.gz
[vtwm.git] / Makefile.QNX
1
2 # Here is a makefile for VTWM.
3 #
4 # It's a hand-tweaked version of the makefile made with xmkmf,
5 # it may prove useful as a template for those who don't have xmkmf.
6 #
7 # This makefile guarantees that the build info is absolutely current.
8 #
9 # djhjr
10
11 # =============== Start of common editables =====================
12
13 # To omit XPM image support, uncomment this
14 #XPM_DEFINE = -DNO_XPM_SUPPORT
15 # and comment these
16 XPMLIB = -lXpm
17 XPMINC =
18 # (version 3.4h of the XPM library is the earliest supported I know of)
19
20 # To omit regular expressions ("RE"s) support, uncomment this
21 #REGEX_DEFINE = -DNO_REGEX_SUPPORT
22 # and comment these
23 REGEXLIB =
24 REGEXINC =
25 # (the library must conform to the POSIX 1003.2 specification)
26
27 # To omit sound support. uncomment this
28 SOUND_DEFINE = -DNO_SOUND_SUPPORT
29 # and comment these
30 #SOUNDLIB = -L/usr/local/lib -lrplay
31 #SOUNDINC = -I/usr/local/include
32 # (sound is supported only by way of the rplay library)
33
34 # To omit Internationalization support, uncomment this
35 I18N_DEFINE = -DNO_I18N_SUPPORT
36
37 # To omit m4 pre-processing of resource files, uncomment this
38 #M4_DEFINE = -DNO_M4_SUPPORT
39
40 # To omit platform and build info in the version window, uncomment this
41 #INFO_DEFINE = -DNO_BUILD_INFO
42
43 # For lexers that don't track line numbers, uncomment this
44 YYLINENO_DEFINE = -DNEED_YYLINENO_V
45
46 # For those systems that don't have putenv(), uncomment this
47 PUTENV_DEFINE = -DNEED_PUTENV_F
48
49 # For those systems that require sys/select.h, uncomment this
50 SELECT_DEFINE = -DNEED_SELECT_H
51
52 # For those systems that require process.h, uncomment this
53 PROCESS_DEFINE = -DNEED_PROCESS_H
54
55 # Installation path for the binary
56 VTWMBINDIR = /usr/bin/X11
57
58 # Installation path for the system resource file
59 VTWMLIBDIR = /usr/lib/X11/twm
60
61 # Installation path for the man page
62 VTWMMANDIR = /usr/man/mann
63
64 # For the traditional look of TWM as the system fallback,
65 # change this to "2D"
66 SYS_VTWMRC_LOOK = 3D
67
68 CDEBUGFLAGS = -w4 -M
69 CCOPTIONS = -Otx -zp1 -mf -b -j -Wc,-s -N32k
70
71 # ================ End of common editables ======================
72
73 # ============= Start of less common editables ==================
74
75 CP = cp -f
76 MV = mv -f
77 RM = rm -f
78 LN = ln -fs
79 CC = cc
80 LEX = lex
81 YACC = yacc
82
83 YFLAGS = -d
84
85 USRLIBDIR = /usr/lib/X11
86
87 # Handy for developers to check man page editions
88 # (see the end of this file)
89 DEROFF = deroff
90 DW = dw
91 SPELL = spell
92
93 # Required to generate HTML or Postscript versions of the man page
94 # (see the end of this file)
95 MAN2HTML = man2html
96 MAN2PS = man2ps
97
98 # ============== End of less common editables ===================
99
100 # ========= Editing below here should not be necessary ==========
101
102 XMULIB = -lXmu
103 XTOOLLIB =
104 EXTENSIONLIB = -lXext
105 XLIB = $(EXTENSIONLIB) -lX11_s
106
107 LOCAL_LIBRARIES = $(XMULIB) $(XTOOLLIB) $(XLIB) \
108                   $(XPMLIB) $(REGEXLIB) $(SOUNDLIB)
109 EXTRA_LIBRARIES = -lXqnx -lsocket
110 LDLIBS = $(LOCAL_LIBRARIES) $(EXTRA_LIBRARIES)
111
112 INCLUDES =
113 EXTRA_INCLUDES = $(XPMINC) $(REGEXINC) $(SOUNDINC)
114 STD_INCLUDES =
115
116 ALLINCLUDES = $(INCLUDES) $(EXTRA_INCLUDES) $(STD_INCLUDES)
117
118 STD_DEFINES = -D__QNX__ -DMetroLink -DSTRINGS_ALIGNED -DNO_REGEX \
119               -DBOGUS_MB_MAX
120 EXTRA_DEFINES = $(XPM_DEFINE) $(SOUND_DEFINE) $(REGEX_DEFINE) \
121                 $(I18N_DEFINE) $(M4_DEFINE) $(INFO_DEFINE) \
122                 $(YYLINENO_DEFINE) $(PUTENV_DEFINE) $(SELECT_DEFINE) \
123                 $(PROCESS_DEFINE)
124 PROTO_DEFINES =
125
126 ALLDEFINES = $(ALLINCLUDES) $(STD_DEFINES) $(EXTRA_DEFINES) $(PROTO_DEFINES)
127
128 CFLAGS = $(CDEBUGFLAGS) $(CCOPTIONS) $(ALLDEFINES) -L$(USRLIBDIR)
129
130 SRCS = gram.c lex.c deftwmrc.c add_window.c gc.c list.c twm.c sound.c \
131         parse.c menus.c events.c resize.c util.c version.c iconmgr.c \
132         cursor.c regions.c applets.c icons.c desktop.c doors.c lastmake.c
133
134 OBJS = gram.o lex.o deftwmrc.o add_window.o gc.o list.o twm.o sound.o \
135         parse.o menus.o events.o resize.o util.o version.o iconmgr.o \
136         cursor.o regions.o applets.o icons.o desktop.o doors.o lastmake.o
137
138 PROGRAM = vtwm
139
140 all: vtwm
141
142 depend: lex.c gram.c deftwmrc.c lastmake.c
143
144 install:
145         $(CP) $(PROGRAM) $(VTWMBINDIR)
146         $(CP) system.vtwmrc $(VTWMLIBDIR)
147         $(CP) doc/vtwm.man $(VTWMMANDIR)
148
149 clean:
150         $(RM) $(PROGRAM) *.o *.b *.err *.map y.tab.h y.tab.c lex.yy.c \
151         gram.h gram.c lex.c deftwmrc.c lastmake.c system.vtwmrc \
152         vtwm.dw vtwm.ser vtwm.html vtwm.ps
153
154 vtwm: $(OBJS)
155         $(RM) $@
156         $(CC) -o $@ $(OBJS) $(CFLAGS) $(LDLIBS)
157         $(RM) deftwmrc.* lastmake.*
158
159 parse.o: gram.h
160         $(RM) $@
161         $(CC) -c $(CFLAGS) '-DSYSTEM_VTWMRC="'$(VTWMLIBDIR)'/system.vtwmrc"' \
162         '-DSYSTEM_TWMRC="'$(VTWMLIBDIR)'/system.twmrc"' parse.c
163
164 add_window.o applets.o events.o icons.o list.o menus.o \
165 regions.o sound.o twm.o util.o: gram.h
166         $(RM) $@
167         $(CC) -c $(CFLAGS) $*.c
168
169 lex.o: gram.h
170
171 gram.h gram.c: gram.y
172         $(YACC) $(YFLAGS) gram.y
173         $(MV) y.tab.c gram.c
174         $(MV) y.tab.h gram.h
175
176 deftwmrc.c:  system.vtwmrc
177         $(RM) $@
178         echo '/* ' >>$@
179         echo ' * This file is generated automatically from the default' >>$@
180         echo ' * VTWM bindings file system.vtwmrc.'$(SYS_VTWMRC_LOOK)' by the VTWM Makefile.' >>$@
181         echo ' */' >>$@
182         echo '' >>$@
183         echo 'char *defTwmrc[] = {' >>deftwmrc.c
184         sed -e '/^$$/d' -e '/^#/d' -e 's/"/\\"/g' -e 's/^/"/' -e 's/$$/",/' -e 's/[     ]\{1,\}/ /g' -e 's/^" /"/' system.vtwmrc >>$@
185         echo '(char *)0 };' >>$@
186
187 lastmake.c:
188         $(RM) $@
189         echo '/* ' >>$@
190         echo ' * This file is generated automatically by the VTWM Makefile.' >>$@
191         echo ' */' >>$@
192         echo '' >>$@
193         echo 'char *lastmake[] = {' >>lastmake.c
194         echo '    "Platform:  '`uname -r -s`'",' >>$@
195         echo '    "Build:  '`date`'",' >>$@
196         echo '    "" };' >>$@
197
198 system.vtwmrc:
199         $(RM) $@
200         $(CP) $@.$(SYS_VTWMRC_LOOK) $@
201
202 # Handy for developers to check the man page
203 dw vtwm.dw: doc/vtwm.man
204         $(DEROFF) doc/vtwm.man | $(DW) >vtwm.dw
205         @if test -s vtwm.dw ; \
206         then \
207             echo Doubled words in vtwm.man ... ; \
208             cat vtwm.dw ; \
209         fi
210 spell vtwm.ser: doc/vtwm.man vtwm.sok
211         $(DEROFF) doc/vtwm.man | $(SPELL) +vtwm.sok >vtwm.ser
212         @if test -s vtwm.ser ; \
213         then \
214             echo Spelling exceptions in vtwm.man ... ; \
215             cat vtwm.ser ; \
216         fi
217
218 # If you wish to generate HTML or Postscript versions of the man page,
219 # enter 'make vtwm.html' or 'make vtwm.ps'
220 vtwm.html: doc/vtwm.man
221         $(MAN2HTML) doc/vtwm.man
222 vtwm.ps: doc/vtwm.man
223         $(MAN2PS) < $< >$@