Lines 1-5
Link Here
|
1 |
# Unix Makefile for XGlk library |
1 |
# Unix Makefile for XGlk library |
2 |
|
2 |
|
|
|
3 |
# Based on the original by Andrew Plotkin. Modified to create a shared |
4 |
# library by Joe Mason. |
5 |
|
6 |
# XGlk 0.4.11 |
7 |
MAJOR=0 |
8 |
MINOR=4 |
9 |
MICRO=11 |
10 |
|
3 |
# This generates two files. One, of course, is libxglk.a -- the library |
11 |
# This generates two files. One, of course, is libxglk.a -- the library |
4 |
# itself. The other is Make.xglk; this is a snippet of Makefile code |
12 |
# itself. The other is Make.xglk; this is a snippet of Makefile code |
5 |
# which locates the xglk library and associated libraries (such as |
13 |
# which locates the xglk library and associated libraries (such as |
Lines 8-13
Link Here
|
8 |
# When you install xglk, you must put libxglk.a in the lib directory, |
16 |
# When you install xglk, you must put libxglk.a in the lib directory, |
9 |
# and glk.h, glkstart.h, and Make.xglk in the include directory. |
17 |
# and glk.h, glkstart.h, and Make.xglk in the include directory. |
10 |
|
18 |
|
|
|
19 |
GLKNAME = xglk |
20 |
GLKINCLUDEDIR = /usr/include/glk |
21 |
GLKLIBDIR = /usr/$(MULTILIB_LIBDIR)/glk |
22 |
|
11 |
# If you get errors in xio.c about fd_set or FD_SET being |
23 |
# If you get errors in xio.c about fd_set or FD_SET being |
12 |
# undefined, put "-DNEEDS_SELECT_H" in the SYSTEMFLAGS line, |
24 |
# undefined, put "-DNEEDS_SELECT_H" in the SYSTEMFLAGS line, |
13 |
# as has been done for the RS6000. |
25 |
# as has been done for the RS6000. |
Lines 37-43
Link Here
|
37 |
# definitions for SGI / Irix |
49 |
# definitions for SGI / Irix |
38 |
#SYSTEMFLAGS = |
50 |
#SYSTEMFLAGS = |
39 |
|
51 |
|
40 |
# definitions for Linux. _BSD_SOURCE may be necessary for struct timezone. |
52 |
# definitions for Linux |
41 |
SYSTEMFLAGS = -D_BSD_SOURCE |
53 |
SYSTEMFLAGS = -D_BSD_SOURCE |
42 |
|
54 |
|
43 |
# -------------------- |
55 |
# -------------------- |
Lines 58-70
Link Here
|
58 |
#XLIB = -L/usr/X11R6/lib -lX11 |
70 |
#XLIB = -L/usr/X11R6/lib -lX11 |
59 |
|
71 |
|
60 |
# for Red Hat Linux |
72 |
# for Red Hat Linux |
61 |
XINCLUDE = -I/usr/local/include -I/usr/X11R6/include/X11 |
73 |
#XINCLUDE = -I/usr/X11R6/include/X11 |
62 |
XLIB = -L/usr/local/lib -L/usr/X11R6/lib -lX11 |
74 |
#XLIB = -L/usr/X11R6/lib -lX11 |
63 |
|
75 |
|
64 |
# for SparcStation / Solaris |
76 |
# for SparcStation / Solaris |
65 |
#XINCLUDE = -I/usr/openwin/include |
77 |
#XINCLUDE = -I/usr/openwin/include |
66 |
#XLIB = -R/usr/openwin/lib -L/usr/openwin/lib/ -lX11 |
78 |
#XLIB = -R/usr/openwin/lib -L/usr/openwin/lib/ -lX11 |
67 |
|
79 |
|
|
|
80 |
XINCLUDE = |
81 |
XLIB = -lX11 |
82 |
|
68 |
# -------------------- |
83 |
# -------------------- |
69 |
|
84 |
|
70 |
# definitions for where the PNG and JPEG libs are. |
85 |
# definitions for where the PNG and JPEG libs are. |
Lines 80-98
Link Here
|
80 |
|
95 |
|
81 |
# definitions for the MikMod library. |
96 |
# definitions for the MikMod library. |
82 |
SDLINCLUDE = $(shell sdl-config --cflags) |
97 |
SDLINCLUDE = $(shell sdl-config --cflags) |
83 |
SDLCFLAGS = \$$\(shell sdl-config --cflags\) |
98 |
SDLCFLAGS = $(shell sdl-config --cflags) |
84 |
SDLLIB = \$$\(shell sdl-config --libs\) -lSDL_mixer |
99 |
SDLLIB = $(shell sdl-config --libs) -lSDL_mixer |
85 |
|
100 |
|
86 |
# -------------------- |
101 |
# -------------------- |
87 |
|
102 |
|
88 |
# Pick a C compiler. |
103 |
# Pick a C compiler. |
89 |
#CC = cc |
104 |
#CC = cc |
90 |
CC = gcc |
105 |
INSTALL = install -g 0 -o 0 |
91 |
|
106 |
|
92 |
CFLAGS = -O -ansi $(PNGFLAG) $(JPEGFLAG) $(PNGINCLUDE) $(JPEGINCLUDE) $(SDLINCLUDE) -Wall -Wmissing-prototypes -Wstrict-prototypes -Wno-unused -Wbad-function-cast $(SYSTEMFLAGS) $(XINCLUDE) |
107 |
CFLAGS += -ansi -I$(GLKINCLUDEDIR) $(PNGFLAG) $(JPEGFLAG) $(PNGINCLUDE) $(SDLINCLUDE) $(JPEGINCLUDE) -Wall -Wmissing-prototypes -Wstrict-prototypes -Wno-unused -Wbad-function-cast $(SYSTEMFLAGS) $(XINCLUDE) |
93 |
LDFLAGS = |
|
|
94 |
LIBS = $(XLIB) $(PNGLIB) $(JPEGLIB) $(SDLLIB) $(SYSTEMLIBS) |
108 |
LIBS = $(XLIB) $(PNGLIB) $(JPEGLIB) $(SDLLIB) $(SYSTEMLIBS) |
95 |
|
109 |
|
|
|
110 |
GLKLIBSHARED = lib$(GLKNAME).la |
111 |
GLKMAKEFILE = Make.$(GLKNAME) |
112 |
|
96 |
OBJS = main.o xglk.o xglk_vars.o xglk_prefs.o xglk_loop.o xglk_init.o \ |
113 |
OBJS = main.o xglk.o xglk_vars.o xglk_prefs.o xglk_loop.o xglk_init.o \ |
97 |
xglk_scrap.o xglk_msg.o xglk_key.o xglk_weggie.o xglk_pict.o \ |
114 |
xglk_scrap.o xglk_msg.o xglk_key.o xglk_weggie.o xglk_pict.o \ |
98 |
xglk_res.o \ |
115 |
xglk_res.o \ |
Lines 101-121
Link Here
|
101 |
xg_schan.o \ |
118 |
xg_schan.o \ |
102 |
gi_dispa.o gi_blorb.o |
119 |
gi_dispa.o gi_blorb.o |
103 |
|
120 |
|
104 |
all: libxglk.a Make.xglk |
121 |
all: $(GLKLIBSHARED) $(GLKMAKEFILE) |
105 |
|
122 |
|
106 |
libxglk.a: $(OBJS) |
123 |
%.o: %.c |
107 |
ar r libxglk.a $(OBJS) |
124 |
libtool --mode=compile $(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $< |
108 |
ranlib libxglk.a |
|
|
109 |
|
125 |
|
110 |
Make.xglk: |
126 |
$(GLKLIBSHARED): $(OBJS) |
111 |
echo LINKLIBS = $(LIBDIRS) $(LIBS) > Make.xglk |
127 |
libtool --mode=link $(CC) $(LDFLAGS) -rpath "$(GLKLIBDIR)" -version-number $(MAJOR):$(MINOR):$(MICRO) -o $@ $(OBJS:.o=.lo) $(LIBDIRS) $(LIBS) |
112 |
echo GLKLIB = -lxglk >> Make.xglk |
|
|
113 |
|
128 |
|
114 |
$(OBJS): xglk.h xg_internal.h xglk_option.h glk.h gi_dispa.h gi_blorb.h |
129 |
$(GLKMAKEFILE): |
|
|
130 |
echo LINKLIBS = $(LIBDIRS) $(LIBS) > $(GLKMAKEFILE) |
131 |
echo GLKLIB = -l$(GLKNAME) >> $(GLKMAKEFILE) |
132 |
|
133 |
$(OBJS): xglk.h xg_internal.h xglk_option.h |
115 |
|
134 |
|
116 |
xg_win_textgrid.o xg_window.o xglk_key.o: xg_win_textgrid.h |
135 |
xg_win_textgrid.o xg_window.o xglk_key.o: xg_win_textgrid.h |
117 |
|
136 |
|
118 |
xg_win_textbuf.o xg_window.o xglk_key.o: xg_win_textbuf.h |
137 |
xg_win_textbuf.o xg_window.o xglk_key.o: xg_win_textbuf.h |
119 |
|
138 |
|
120 |
clean: |
139 |
install: |
121 |
-rm -f *~ *.o libxglk.a Make.xglk |
140 |
$(INSTALL) -m 2775 -d "$(DESTDIR)$(GLKINCLUDEDIR)" |
|
|
141 |
$(INSTALL) -m 0644 $(GLKMAKEFILE) "$(DESTDIR)$(GLKINCLUDEDIR)" |
142 |
$(INSTALL) -m 2775 -d "$(DESTDIR)$(GLKLIBDIR)" |
143 |
libtool --mode=install install $(GLKLIBSHARED) "$(DESTDIR)$(GLKLIBDIR)" |
144 |
|