Makefile.sgi revision c041511d
1#! smake
2#
3# Copyright (c) Mark J. Kilgard, 1995, 1998.
4#
5include $(ROOT)/usr/include/make/commondefs
6
7# NOTE:  In my GLUT development tree, many of the C source files for
8# GLUT are generated.  For this reason, "make full_clobber" will remove
9# these generated C files, while "make clobber" will not.
10
11TOP = ../..
12
13TARGETS = libglut.a
14
15LN = ln -s
16MV = mv
17RM = -rm -rf
18
19HDRS = glutint.h glutstroke.h layerutil.h glutbitmap.h
20
21SRCS = \
22	glut_bitmap.c \
23	glut_bwidth.c \
24	glut_cindex.c \
25	glut_cmap.c \
26	glut_cursor.c \
27	glut_dials.c \
28	glut_dstr.c \
29	glut_event.c \
30	glut_ext.c \
31	glut_fbc.c \
32	glut_fullscrn.c \
33	glut_gamemode.c \
34	glut_get.c \
35	glut_glxext.c \
36	glut_init.c \
37	glut_input.c \
38	glut_joy.c \
39	glut_key.c \
40	glut_keyctrl.c \
41	glut_keyup.c \
42	glut_menu.c \
43	glut_menu2.c \
44	glut_mesa.c \
45	glut_modifier.c \
46	glut_overlay.c \
47	glut_shapes.c \
48	glut_space.c \
49	glut_stroke.c \
50	glut_swap.c \
51	glut_swidth.c \
52	glut_tablet.c \
53	glut_teapot.c \
54	glut_util.c \
55	glut_vidresize.c \
56	glut_warp.c \
57	glut_win.c \
58	glut_winmisc.c \
59	layerutil.c
60
61SRCSSEMIGENS = \
62	glut_8x13.c \
63	glut_9x15.c \
64	glut_hel10.c \
65	glut_hel12.c \
66	glut_hel18.c \
67	glut_mroman.c \
68	glut_roman.c \
69	glut_tr10.c \
70	glut_tr24.c
71
72OBJS = $(SRCS:.c=.o) $(SRCSSEMIGENS:.c=.o)
73OTHERGENS = y.tab.c y.tab.h strokegen.c strokegen.h strokelex.c
74OTHERSRCS = strokegen.y strokelex.l stroke.h
75FONTS = Roman.stroke MonoRoman.stroke
76
77# Uncomment the LCDEFS line below if you want to build a version of
78# libglut.a that avoids using the SGI "fast atoms" optimization
79# introduced in IRIX 6.3.  This optimization eliminates serveral X server
80# round-trips.  If you are building libglut.a on an IRIX 6.3 or later
81# machine and want a chance (no guarantees) that GLUT executables built
82# against your libglut.a will work on IRIX 6.2 machines, uncomment out
83# the LCDEFS line below.  Otherwise, you'll get a run-time message about
84# "attempted access to unresolvable symbol in XXX: _XSGIFastInternAtom"
85#LCDEFS = -DNO_FAST_ATOMS
86
87LCOPTS = -I$(TOP)/include -fullwarn 
88LWOFF = ,813,852,827,826
89LDIRT = *~ $(OTHERGENS) strokegen *.bak hardcopy glutsrc.ps capturexfont *.pure dstr dstr.c *.gen
90
91default: $(TARGETS)
92
93sinclude ObjectType.mk
94
95$(OBJS) : $(HDRS)
96
97libglut.a : $(OBJS)
98	$(RM) $@
99	$(AR) crl $@ $(OBJS)
100
101.ORDER : strokegen.h strokegen.c
102
103strokegen.h strokegen.c : strokegen.y
104	$(YACC) -d strokegen.y
105	$(MV) y.tab.c strokegen.c
106	$(MV) y.tab.h strokegen.h
107
108# avoid warnings when compiling lex generated code
109strokegen.o : strokegen.c
110	$(CC) $(CFLAGS) -woff 726,825,635,818,819,820,824,831,835,822,821,1167,1498,1116,1136,1174,1196,803 -c -MDupdate Makedepend strokegen.c
111
112strokelex.c : strokelex.l
113	$(LEX) strokelex.l
114	$(MV) lex.yy.c strokelex.c
115
116# avoid warnings when compiling lex generated code
117strokelex.o : strokelex.c
118	$(CC) $(CFLAGS) -woff 831,825,817,835,702,819,635,824,822,1167,1498,1110,1196,1174,803 -c -MDupdate Makedepend strokelex.c
119
120strokegen : strokegen.o strokelex.o
121	$(CC) -o $@ $(LDFLAGS) strokegen.o strokelex.o -ll
122
123capturexfont : capturexfont.o
124	$(CC) -o $@ $(LDFLAGS) capturexfont.o -lX11
125
126# glut_roman.c and glut_mroman.c are now checked in, but here are rules to generate them
127glut_roman.c.gen : Roman.stroke strokegen
128	./strokegen -s glutStrokeRoman < Roman.stroke > $@
129glut_mroman.c.gen : MonoRoman.stroke strokegen
130	./strokegen -s glutStrokeMonoRoman < MonoRoman.stroke > $@
131
132glutsrc.ps : $(SRCS)
133	$(RM) hardcopy
134	mkdir -p hardcopy
135	for i in $(SRCS) ;\
136	do \
137	  grep -v CENTRY $$i | grep -v INDENT- > hardcopy/$$i; \
138	done
139	cd hardcopy ; enscript -p ../$@ -G -2r `echo $(SRCS) | fmt -1 | sort`
140	$(RM) hardcopy
141
142# The bitmap files can be generated using capturexfont, but because
143# they require a connection to an X server and potentially different
144# X servers have different fonts, these generated files are part
145# of the GLUT distribution.
146
1479_BY_15 = -misc-fixed-medium-r-normal--15-140-75-75-C-90-iso8859-1
1488_BY_13 = -misc-fixed-medium-r-normal--13-120-75-75-C-80-iso8859-1
149TR10 = -adobe-times-medium-r-normal--10-100-75-75-p-54-iso8859-1
150TR24 = -adobe-times-medium-r-normal--24-240-75-75-p-124-iso8859-1
151HEL10 = -adobe-helvetica-medium-r-normal--10-100-75-75-p-56-iso8859-1
152HEL12 = -adobe-helvetica-medium-r-normal--12-120-75-75-p-67-iso8859-1
153HEL18 = -adobe-helvetica-medium-r-normal--18-180-75-75-p-98-iso8859-1
154
155semigens : capturexfont
156	./capturexfont $(9_BY_15) glutBitmap9By15 > glut_9x15.c.gen
157	./capturexfont $(8_BY_13) glutBitmap8By13 > glut_8x13.c.gen
158	./capturexfont $(TR10) glutBitmapTimesRoman10 > glut_tr10.c.gen
159	./capturexfont $(TR24) glutBitmapTimesRoman24 > glut_tr24.c.gen
160	./capturexfont $(HEL10) glutBitmapHelvetica10 > glut_hel10.c.gen
161	./capturexfont $(HEL12) glutBitmapHelvetica12 > glut_hel12.c.gen
162	./capturexfont $(HEL18) glutBitmapHelvetica18 > glut_hel18.c.gen
163
164# unused test rule for test building 16-bit font
165JIS = -jis-fixed-medium-r-normal--24-230-75-75-c-240-jisx0208.1983-0
166glut_jis.c : 
167	./capturexfont $(JIS) glutBitmapJis > $@
168
169sources: $(SRCS)
170
171symcheck: libglut.a
172	-nm -Bo libglut.a | grep -v ' d ' | grep -v ' T glut' | grep -v ' D glut' | grep -v ' U ' | grep -v ' T __glut' | grep -v ' t ' | grep -v ' b ' | grep -v ' D __glut' | grep -v ' B __glut'
173
174dstr.c: glut_dstr.c
175	ln -s glut_dstr.c $@
176
177dstr: dstr.c glut_util.o glut_glxext.o
178	$(RM) $@
179	$(CC) -g -o $@ $(CFLAGS) -DTEST dstr.c glut_util.o glut_glxext.o -lGLU -lGL -lXext -lX11 -lm
180
181./glut.h : glut.h
182./glutint.h : glutint.h
183./glutstroke.h : glutstroke.h
184./strokegen.h : strokegen.h
185./stroke.h : stroke.h
186./layerutil.h : layerutil.h
187strokelex.o: strokelex.c strokegen.h
188
189include $(COMMONRULES)
190