1 | #! gmake |
---|
2 | |
---|
3 | # |
---|
4 | # Brian Curless |
---|
5 | # |
---|
6 | # Computer Graphics Laboratory |
---|
7 | # Stanford University |
---|
8 | # |
---|
9 | # --------------------------------------------------------------------- |
---|
10 | # |
---|
11 | # Copyright (1997) The Board of Trustees of the Leland Stanford Junior |
---|
12 | # University. Except for commercial resale, lease, license or other |
---|
13 | # commercial transactions, permission is hereby given to use, copy, |
---|
14 | # modify this software for academic purposes only. No part of this |
---|
15 | # software or any derivatives thereof may be used in the production of |
---|
16 | # computer models for resale or for use in a commercial |
---|
17 | # product. STANFORD MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND |
---|
18 | # CONCERNING THIS SOFTWARE. No support is implied or provided. |
---|
19 | # |
---|
20 | |
---|
21 | |
---|
22 | ifndef OPTIMIZER |
---|
23 | OPTIMIZER = -O |
---|
24 | endif |
---|
25 | |
---|
26 | # Get OS uname |
---|
27 | UNAME := $(shell uname) |
---|
28 | |
---|
29 | ifeq ($(UNAME), IRIX) |
---|
30 | |
---|
31 | # Set optimizer flags to allow it to run on Indys... |
---|
32 | ifeq ($(OPTIMIZER), -O) |
---|
33 | OPTIMIZER = -O -mips3 |
---|
34 | endif #OPTIMIZER |
---|
35 | |
---|
36 | CXXSRCS := $(CXXSRCS) $(SGICXXSRCS) |
---|
37 | TARGETS := $(TARGETS) $(SGITARGETS) |
---|
38 | |
---|
39 | CC = cc |
---|
40 | CXX = CC |
---|
41 | |
---|
42 | CFLAGS = -woff3262 -woff1174 -woff1356 |
---|
43 | CXXFLAGS = -woff3262 -woff1174 -woff1356 |
---|
44 | |
---|
45 | INCLS = -I. -I$(ROOT)/include |
---|
46 | |
---|
47 | LIBPATHS = -L. -L$(ROOT)/lib |
---|
48 | |
---|
49 | else |
---|
50 | |
---|
51 | # Set special optimizer flags... |
---|
52 | ifeq ($(OPTIMIZER), -O) |
---|
53 | OPTIMIZER = -O6 -march=i686 -malign-double \ |
---|
54 | -funroll-loops -fomit-frame-pointer -ffast-math |
---|
55 | endif |
---|
56 | |
---|
57 | CC = gcc |
---|
58 | CXX = g++ |
---|
59 | |
---|
60 | CFLAGS = -DLINUX -Wno-unused |
---|
61 | CXXFLAGS = -DLINUX -Wno-unused |
---|
62 | |
---|
63 | INCLS = -I. -I$(ROOT)/include |
---|
64 | |
---|
65 | LIBPATHS = -L. -L$(ROOT)/lib |
---|
66 | |
---|
67 | endif |
---|
68 | |
---|
69 | CFLAGS := $(INCLS) -DFUNCPROTO -DHAVE_UNISTD_H $(CFLAGS) |
---|
70 | CXXFLAGS := $(INCLS) -DFUNCPROTO -DHAVE_UNISTD_H $(CXXFLAGS) |
---|
71 | CC := $(CC) $(OPTIMIZER) |
---|
72 | CXX := $(CXX) $(OPTIMIZER) |
---|
73 | |
---|
74 | |
---|
75 | default: all |
---|
76 | |
---|
77 | all: $(TARGETS) |
---|
78 | |
---|
79 | install: clobber depend all |
---|
80 | |
---|
81 | clobber: |
---|
82 | -/bin/rm -f *.o *~ core makedep $(TARGETS) |
---|
83 | |
---|
84 | clean: |
---|
85 | -/bin/rm -f *.o *~ core |
---|
86 | |
---|
87 | depend: |
---|
88 | echo > makedep |
---|
89 | gccmakedep -fmakedep -- $(CFLAGS) -- $(CSRCS) $(CXXSRCS) |
---|
90 | -rm makedep.bak |
---|
91 | |
---|
92 | -include makedep |
---|