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 -64 |
---|
22 | OPTIMIZER = -O |
---|
23 | endif |
---|
24 | |
---|
25 | # Get OS uname |
---|
26 | UNAME := $(shell uname) |
---|
27 | |
---|
28 | ifeq ($(UNAME), IRIX) |
---|
29 | |
---|
30 | # Set optimizer flags to allow it to run on Indys... |
---|
31 | ifeq ($(OPTIMIZER), -O) |
---|
32 | OPTIMIZER = -O -mips3 |
---|
33 | endif #OPTIMIZER |
---|
34 | |
---|
35 | TARGETS := $(TARGETS) |
---|
36 | |
---|
37 | CC = cc |
---|
38 | CXX = CC |
---|
39 | |
---|
40 | CFLAGS = -MDupdate makedep -woff3262 -woff1174 -woff1356 |
---|
41 | CXXFLAGS = -MDupdate makedep -woff3262 -woff1174 -woff1356 |
---|
42 | |
---|
43 | INCLS = -I. -I$(ROOT)/include |
---|
44 | |
---|
45 | LIBPATHS = -L. -L$(ROOT)/lib |
---|
46 | |
---|
47 | else |
---|
48 | |
---|
49 | # Set special optimizer flags... |
---|
50 | ifeq ($(OPTIMIZER), -O) |
---|
51 | OPTIMIZER = -O6 -march=i686 -malign-double -fno-for-scope \ |
---|
52 | -funroll-loops -fomit-frame-pointer -ffast-math |
---|
53 | endif |
---|
54 | |
---|
55 | CC = gcc |
---|
56 | CXX = g++ |
---|
57 | |
---|
58 | CFLAGS = -DLINUX -Wno-unused |
---|
59 | CXXFLAGS = -DLINUX -Wno-unused |
---|
60 | |
---|
61 | INCLS = -I. -I$(ROOT)/include |
---|
62 | |
---|
63 | LIBPATHS = -L. -L$(ROOT)/lib |
---|
64 | |
---|
65 | endif |
---|
66 | |
---|
67 | SRCS = $(CXXSRCS) $(CSRCS) |
---|
68 | OBJS = $(CXXSRCS:.cc=.o) $(CSRCS:.c=.o) |
---|
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 | default: all |
---|
77 | |
---|
78 | all: $(TARGETS) |
---|
79 | |
---|
80 | install: clobber depend all |
---|
81 | |
---|
82 | clobber: |
---|
83 | -/bin/rm -f *.o *~ core makedep $(TARGETS) |
---|
84 | |
---|
85 | clean: |
---|
86 | -/bin/rm -f *.o *~ core |
---|
87 | |
---|
88 | depend: |
---|
89 | echo > makedep |
---|
90 | gccmakedep -fmakedep -- $(CFLAGS) -- $(CSRCS) $(CXXSRCS) |
---|
91 | -rm makedep.bak |
---|
92 | |
---|
93 | -include makedep |
---|