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