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