-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.solaris
132 lines (105 loc) · 3.75 KB
/
Makefile.solaris
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
#
# Makefile for the Solaris version of battalion 1.3
# (to produce Mesa + OpenGL + TGS binaries)
#
# 9-July-96
#
# Now possible to build a battalion binary "battalion.tgs" using the
# TGS (Template Graphics Software) implementation of OpenGL for ZX.
#
#--------------- Solaris battalion 1.2 --------------------
#
# Makefile targets to build binaries are "mesa", "ogl" and "tgs".
# The ogl and tgs targets create their object files (but not the binary)
# in subdirectories "opengl" and "tgs" to separate them from Mesa object
# files.
#
# Other targets:
#
# Run "make buildlinks.ogl" ONCE to create the opengl directory and the
# symbolic links in it. This will destroy whatever is in the directory!
# "make buildlinks.tgs" does the same thing for the TGS version.
#
# "make clean" removes Mesa object files, "make clean.ogl" removes
# OpenGL object files and "make clean.tgl" removes TGS object files.
#
# "make clean.bin" removes the Mesa, OpenGL and TGS binaries.
OBJS = gprim.o audio.o text.o objects.o net.o graphics.o update.o battalion.o tk.o
HDRS = battalion.h tk.h
MESABIN = battalion.mesa
OGLBIN = battalion.opengl
TGSBIN = battalion.tgs
# The subdirectory to create OpenGL objects files in
OGLDIR = opengl
# The TGS subdirectory
TGSDIR = leo
# Sun audio library
LIBAUDIO = /usr/demo/SOUND
#--- Generic options ---
OPT = -Xa -xCC -DSOLARIS -DSUNAUDIO
# Optimization flags. xunroll=10 seems to be optimal at
# least for a Voyager (with microSPARC CPU).
OPT += -fast -xO4 -fsimple=2 -dalign -xlibmil -xunroll=10
INCLS = -I/usr/openwin/include -I$(LIBAUDIO)/include
CFLAGS = $(OPT) $(TARGETOPT) $(INCLS)
#--- Mesa version: "make" or "make mesa" ---
#
MESAHOME = /usr/local
$(MESABIN) := TARGETOPT = -DMESAVERSION -DDETAIL=0 -xtarget=ss20/61
#$(MESABIN) := TARGETOPT = -DMESAVERSION -DDETAIL=0 -xtarget=ssvyger
$(MESABIN) := INCLS += -I$(MESAHOME)/include
#-- Uncomment only one of the MESALIBS definitions below
# Link Mesa statically
MESALIBS = -L$(MESAHOME)/lib -Bstatic -lMesaGL -lMesaGLU -Bdynamic \
-L/usr/openwin/lib -lXext -lX11 -lnsl -lsocket \
-L$(LIBAUDIO)/lib -laudio -lmopt -lm -lposix4 -R/usr/openwin/lib
# Link Mesa dynamically
#MESALIBS = -L$(MESAHOME)/lib -lMesaGL -lMesaGLU -L/usr/openwin/lib -lXext \
# -lX11 -lnsl -lsocket -lmopt -lm -R/usr/openwin/lib:/usr/local/lib
#--- Sun OpenGL version: "make ogl" ---
#
$(OGLBIN) := TARGETOPT = -DDETAIL=2 -xtarget=ultra -xarch=v8plusa -xchip=ultra
OGLLIBS = -L/usr/openwin/lib -lGL -lGLU -lXext -lX11 -lnsl -lsocket \
-L$(LIBAUDIO)/lib -laudio -lmopt -lm -lposix4 -R/usr/openwin/lib
#--- TGS version for ZX: "make tgs" ---
#
TGSHOME = /gp/opengl/tgs
$(TGSBIN) := TARGETOPT = -DDETAIL=2 -xtarget=ss20/61
$(TGSBIN) := INCLS = -I$(TGSHOME)/include -I/usr/openwin/include \
-I$(LIBAUDIO)/include
TGSLIBS = -L$(TGSHOME)/lib -lGLU -lGL -L/usr/openwin/lib -ldga \
-lXext -lX11 -lnsl -lsocket \
-L$(LIBAUDIO)/lib -laudio -lmopt -lm -lposix4 -R/usr/openwin/lib
#--------------------------------------------------------
# Defines the default target
all: mesa
mesa:
$(MAKE) $(MESABIN)
ogl:
cd $(OGLDIR); $(MAKE) $(OGLBIN)
tgs:
cd $(TGSDIR); $(MAKE) $(TGSBIN)
$(MESABIN): $(OBJS) $(HDRS)
$(CC) $(CFLAGS) $(OBJS) $(MESALIBS) -o $@
$(OGLBIN): $(OBJS) $(HDRS)
$(CC) $(CFLAGS) $(OBJS) $(OGLLIBS) -o ../$@
$(TGSBIN): $(OBJS) $(HDRS)
$(CC) $(CFLAGS) $(OBJS) $(TGSLIBS) -o ../$@
tk.o font.o: $(HDRS)
gprim.o audio.o text.o objects.o net.o graphics.o update.o battalion.o: battalion.h
clean:
rm -f $(OBJS)
clean.ogl:
cd $(OGLDIR); rm -f $(OBJS)
clean.tgs:
cd $(TGSDIR); rm -f $(OBJS)
clean.bin:
rm -f $(MESABIN) $(OGLBIN) $(TGSBIN)
buildlinks.ogl:
rm -rf $(OGLDIR)
mkdir $(OGLDIR)
cd $(OGLDIR); ln -s ../*.c ../*.h ../Makefile .
buildlinks.tgs:
rm -rf $(TGSDIR)
mkdir $(TGSDIR)
cd $(TGSDIR); ln -s ../*.c ../*.h ../Makefile .