1 | #!/usr/sbin/make |
---|
2 | |
---|
3 | # |
---|
4 | # Homan Igehy |
---|
5 | # |
---|
6 | # Modified by: Brian Curless |
---|
7 | # |
---|
8 | # Computer Graphics Laboratory |
---|
9 | # Stanford University |
---|
10 | # |
---|
11 | # --------------------------------------------------------------------- |
---|
12 | # |
---|
13 | # Copyright (1997-2001) The Board of Trustees of the Leland Stanford |
---|
14 | # Junior University. Except for commercial resale, lease, license or |
---|
15 | # other commercial transactions, permission is hereby given to use, |
---|
16 | # copy, modify this software for academic purposes only. No part of |
---|
17 | # this software or any derivatives thereof may be used in the |
---|
18 | # production of computer models for resale or for use in a commercial |
---|
19 | # product. STANFORD MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY |
---|
20 | # KIND CONCERNING THIS SOFTWARE. No support is implied or provided. |
---|
21 | # |
---|
22 | |
---|
23 | ifndef OPTIMIZER |
---|
24 | OPTIMIZER = -O |
---|
25 | endif |
---|
26 | |
---|
27 | ROOT = ../.. |
---|
28 | |
---|
29 | # Get OS uname |
---|
30 | UNAME := $(shell uname) |
---|
31 | |
---|
32 | ifeq ($(UNAME), IRIX) |
---|
33 | |
---|
34 | # Set optimizer flags to allow it to run on Indys... |
---|
35 | ifeq ($(OPTIMIZER), -O) |
---|
36 | OPTIMIZER = -O -mips3 |
---|
37 | endif #OPTIMIZER |
---|
38 | |
---|
39 | CPP = CC |
---|
40 | |
---|
41 | CCFLAGS = -woff3262 |
---|
42 | |
---|
43 | INCLS = -I. -I$(ROOT)/include |
---|
44 | |
---|
45 | LIBPATHS = -L. -L$(ROOT)/lib |
---|
46 | |
---|
47 | LIBS = -lply -llinear -ltclrl -lreadline -ltermcap \ |
---|
48 | -ltk -ltcl -lsl -lX11 -lc -lm |
---|
49 | |
---|
50 | ASFLAGS = -mips2 -O2 |
---|
51 | |
---|
52 | else |
---|
53 | |
---|
54 | # Set special optimizer flags... |
---|
55 | ifeq ($(OPTIMIZER),-O) |
---|
56 | OPTIMIZER = -O6 -march=i686 -malign-double -fno-for-scope \ |
---|
57 | -funroll-loops -fomit-frame-pointer -ffast-math |
---|
58 | endif |
---|
59 | |
---|
60 | CPP = g++ |
---|
61 | |
---|
62 | CCFLAGS = -DLINUX -Wno-unused |
---|
63 | |
---|
64 | INCLS = -I. -I$(ROOT)/include |
---|
65 | |
---|
66 | LIBPATHS = -L. -L$(ROOT)/lib |
---|
67 | |
---|
68 | endif |
---|
69 | |
---|
70 | CCFLAGS := $(INCLS) -DFUNCPROTO -DHAVE_UNISTD_H $(CCFLAGS) |
---|
71 | CPP := $(CPP) $(OPTIMIZER) |
---|
72 | |
---|
73 | SHELL = /bin/sh |
---|
74 | AS = as |
---|
75 | AR = ar |
---|
76 | AWK = awk |
---|
77 | TR2CL = trunc_to_ceil.awk |
---|
78 | |
---|
79 | HACK = -DInterpolate_$$Interp -DConstant_$$Const \ |
---|
80 | -DSampleCalc_$$Calc -DFrameBuffer_$$Frame \ |
---|
81 | |
---|
82 | |
---|
83 | TRI_OBJS = \ |
---|
84 | sl_triangle_ZI_None_Dda_Intensity.o |
---|
85 | |
---|
86 | TRI_FILES = makefile sl_triangle.C sl_common.H sl_common.I sl_hack.H \ |
---|
87 | sl_vertex.H sl_val.H sl_framebuffer.H sl_framebuffer.I \ |
---|
88 | sl_texture.H sl_texture.I |
---|
89 | |
---|
90 | SL_OBJS = $(TRI_OBJS) |
---|
91 | SL_LIB = libsl.a |
---|
92 | |
---|
93 | default: $(SL_LIB) |
---|
94 | |
---|
95 | all: $(SL_LIB) |
---|
96 | |
---|
97 | install: clobber depend all |
---|
98 | |
---|
99 | $(SL_LIB): makefile $(SL_OBJS) |
---|
100 | $(AR) ru $@ $(SL_OBJS) |
---|
101 | |
---|
102 | $(TRI_OBJS): $(TRI_FILES) |
---|
103 | Interp=`echo $@|$(AWK) -F_ '{print $$3}'`;\ |
---|
104 | Const=`echo $@|$(AWK) -F_ '{print $$4}'`;\ |
---|
105 | Calc=`echo $@|$(AWK) -F_ '{print $$5}'`;\ |
---|
106 | Frame=`echo $@|$(AWK) -F_ '{print $$6}'|$(AWK) -F. '{print $$1}'`;\ |
---|
107 | File=`echo $@ | $(AWK) -F_ '{print $$1"_"$$2}'`;\ |
---|
108 | $(CPP) $(HACK) $(CCFLAGS) -c $$File.C -o $@ |
---|
109 | |
---|
110 | clean: |
---|
111 | -/bin/rm -f *~ *.o *.s *.S core |
---|
112 | |
---|
113 | clobber: |
---|
114 | -/bin/rm -f *~ *.o *.s *.S makedep core curtest core Makedepend \ |
---|
115 | mon.out libsl.a |
---|
116 | |
---|
117 | depend: |
---|
118 | echo > makedep |
---|
119 | gccmakedep -fmakedep -- $(CFLAGS) -- $(CSRCS) |
---|
120 | -rm makedep.bak |
---|
121 | |
---|
122 | -include makedep |
---|
123 | |
---|
124 | # DO NOT DELETE |
---|