2 # Here is a makefile for VTWM.
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.
7 # This makefile guarantees that the build info is absolutely current.
11 # =============== Start of common editables =====================
13 # To omit XPM image support, uncomment this
14 #XPM_DEFINE = -DNO_XPM_SUPPORT
18 # (version 3.4h of the XPM library is the earliest supported I know of)
20 # To omit regular expressions ("RE"s) support, uncomment this
21 #REGEX_DEFINE = -DNO_REGEX_SUPPORT
25 # (the library must conform to the POSIX 1003.2 specification)
27 # To omit sound support. uncomment this
28 SOUND_DEFINE = -DNO_SOUND_SUPPORT
30 #SOUNDLIB = -L/usr/local/lib -lrplay
31 #SOUNDINC = -I/usr/local/include
32 # (sound is supported only by way of the rplay library)
34 # To omit Internationalization support, uncomment this
35 I18N_DEFINE = -DNO_I18N_SUPPORT
37 # To omit m4 pre-processing of resource files, uncomment this
38 #M4_DEFINE = -DNO_M4_SUPPORT
40 # To omit platform and build info in the version window, uncomment this
41 #INFO_DEFINE = -DNO_BUILD_INFO
43 # For lexers that don't track line numbers, uncomment this
44 YYLINENO_DEFINE = -DNEED_YYLINENO_V
46 # For those systems that don't have putenv(), uncomment this
47 PUTENV_DEFINE = -DNEED_PUTENV_F
49 # For those systems that require sys/select.h, uncomment this
50 SELECT_DEFINE = -DNEED_SELECT_H
52 # For those systems that require process.h, uncomment this
53 PROCESS_DEFINE = -DNEED_PROCESS_H
55 # Installation path for the binary
56 VTWMBINDIR = /usr/bin/X11
58 # Installation path for the system resource file
59 VTWMLIBDIR = /usr/lib/X11/twm
61 # Installation path for the man page
62 VTWMMANDIR = /usr/man/mann
64 # For the traditional look of TWM as the system fallback,
69 CCOPTIONS = -Otx -zp1 -mf -b -j -Wc,-s -N32k
71 # ================ End of common editables ======================
73 # ============= Start of less common editables ==================
85 USRLIBDIR = /usr/lib/X11
87 # Handy for developers to check man page editions
88 # (see the end of this file)
93 # Required to generate HTML or Postscript versions of the man page
94 # (see the end of this file)
98 # ============== End of less common editables ===================
100 # ========= Editing below here should not be necessary ==========
104 EXTENSIONLIB = -lXext
105 XLIB = $(EXTENSIONLIB) -lX11_s
107 LOCAL_LIBRARIES = $(XMULIB) $(XTOOLLIB) $(XLIB) \
108 $(XPMLIB) $(REGEXLIB) $(SOUNDLIB)
109 EXTRA_LIBRARIES = -lXqnx -lsocket
110 LDLIBS = $(LOCAL_LIBRARIES) $(EXTRA_LIBRARIES)
113 EXTRA_INCLUDES = $(XPMINC) $(REGEXINC) $(SOUNDINC)
116 ALLINCLUDES = $(INCLUDES) $(EXTRA_INCLUDES) $(STD_INCLUDES)
118 STD_DEFINES = -D__QNX__ -DMetroLink -DSTRINGS_ALIGNED -DNO_REGEX \
120 EXTRA_DEFINES = $(XPM_DEFINE) $(SOUND_DEFINE) $(REGEX_DEFINE) \
121 $(I18N_DEFINE) $(M4_DEFINE) $(INFO_DEFINE) \
122 $(YYLINENO_DEFINE) $(PUTENV_DEFINE) $(SELECT_DEFINE) \
126 ALLDEFINES = $(ALLINCLUDES) $(STD_DEFINES) $(EXTRA_DEFINES) $(PROTO_DEFINES)
128 CFLAGS = $(CDEBUGFLAGS) $(CCOPTIONS) $(ALLDEFINES) -L$(USRLIBDIR)
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
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
142 depend: lex.c gram.c deftwmrc.c lastmake.c
145 $(CP) $(PROGRAM) $(VTWMBINDIR)
146 $(CP) system.vtwmrc $(VTWMLIBDIR)
147 $(CP) doc/vtwm.man $(VTWMMANDIR)
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
156 $(CC) -o $@ $(OBJS) $(CFLAGS) $(LDLIBS)
157 $(RM) deftwmrc.* lastmake.*
161 $(CC) -c $(CFLAGS) '-DSYSTEM_VTWMRC="'$(VTWMLIBDIR)'/system.vtwmrc"' \
162 '-DSYSTEM_TWMRC="'$(VTWMLIBDIR)'/system.twmrc"' parse.c
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
167 $(CC) -c $(CFLAGS) $*.c
171 gram.h gram.c: gram.y
172 $(YACC) $(YFLAGS) gram.y
176 deftwmrc.c: system.vtwmrc
179 echo ' * This file is generated automatically from the default' >>$@
180 echo ' * VTWM bindings file system.vtwmrc.'$(SYS_VTWMRC_LOOK)' by the VTWM Makefile.' >>$@
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 };' >>$@
190 echo ' * This file is generated automatically by the VTWM Makefile.' >>$@
193 echo 'char *lastmake[] = {' >>lastmake.c
194 echo ' "Platform: '`uname -r -s`'",' >>$@
195 echo ' "Build: '`date`'",' >>$@
200 $(CP) $@.$(SYS_VTWMRC_LOOK) $@
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 ; \
207 echo Doubled words in vtwm.man ... ; \
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 ; \
214 echo Spelling exceptions in vtwm.man ... ; \
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