[37] | 1 | # |
---|
| 2 | # Brian Curless |
---|
| 3 | # |
---|
| 4 | # Computer Graphics Laboratory |
---|
| 5 | # Stanford University |
---|
| 6 | # |
---|
| 7 | # --------------------------------------------------------------------- |
---|
| 8 | # |
---|
| 9 | # Copyright (1997-2001) 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 = -D_BOOL -woff3262 -woff1174 |
---|
| 37 | CXXFLAGS = -D_BOOL -woff3262 -woff1174 |
---|
| 38 | |
---|
| 39 | INCLS = -I. -I$(ROOT)/include |
---|
| 40 | |
---|
| 41 | LIBPATHS = -L. -L$(ROOT)/lib |
---|
| 42 | |
---|
| 43 | else |
---|
| 44 | |
---|
| 45 | # Get processor |
---|
| 46 | MACHINE := $(shell uname -m) |
---|
| 47 | |
---|
| 48 | # Set special optimizer flags... |
---|
| 49 | ifeq ($(OPTIMIZER),-O) |
---|
| 50 | OPTIMIZER = -O6 -funroll-loops -fomit-frame-pointer -ffast-math |
---|
| 51 | ifeq ($(MACHINE),i686) |
---|
| 52 | OPTIMIZER := $(OPTIMIZER) -march=i686 -malign-double |
---|
| 53 | endif |
---|
| 54 | endif |
---|
| 55 | |
---|
| 56 | CC = gcc |
---|
| 57 | CXX = g++ |
---|
| 58 | |
---|
| 59 | CFLAGS = -DLINUX -D_BOOL -Wno-unused \ |
---|
| 60 | -Wmissing-declarations |
---|
| 61 | CXXFLAGS = -DLINUX -D_BOOL -Wno-unused -fno-for-scope |
---|
| 62 | |
---|
| 63 | INCLS = -I. -I$(ROOT)/include |
---|
| 64 | |
---|
| 65 | LIBPATHS = -L. -L$(ROOT)/lib |
---|
| 66 | |
---|
| 67 | endif |
---|
| 68 | |
---|
| 69 | SRCS = $(CXXREGFILES) $(CXXLIBFILES) $(CXXFILES) $(CFILES) $(CXXSRCS) $(CSRCS) |
---|
| 70 | |
---|
| 71 | # C++ object files |
---|
| 72 | CXXOBJS = $(CXXREGFILES:.cc=.o) $(CXXSRCS:.cc=.o) $(CXXFILES:.cc=.o) |
---|
| 73 | CXXLIBOBJS = $(CXXLIBFILES:.cc=.o) |
---|
| 74 | |
---|
| 75 | COBJS = $(CFILES:.c=.o) $(CSRCS:.c=.o) |
---|
| 76 | |
---|
| 77 | OBJS = $(CXXOBJS) $(COBJS) |
---|
| 78 | |
---|
| 79 | CFLAGS := $(INCLS) -DFUNCPROTO -DHAVE_UNISTD_H $(CFLAGS) |
---|
| 80 | CXXFLAGS := $(INCLS) -DFUNCPROTO -DHAVE_UNISTD_H $(CXXFLAGS) |
---|
| 81 | CC := $(CC) $(OPTIMIZER) |
---|
| 82 | CXX := $(CXX) $(OPTIMIZER) |
---|
| 83 | |
---|
| 84 | |
---|
| 85 | default: all |
---|
| 86 | |
---|
| 87 | all: $(TARGETS) |
---|
| 88 | |
---|
| 89 | install: clobber depend all |
---|
| 90 | |
---|
| 91 | clean: |
---|
| 92 | -/bin/rm -f *.o *~ core |
---|
| 93 | |
---|
| 94 | clobber: |
---|
| 95 | -/bin/rm -f *.o *~ core makedep $(TARGETS) |
---|
| 96 | |
---|
| 97 | depend: |
---|
| 98 | echo > makedep |
---|
| 99 | gccmakedep -fmakedep -- $(CFLAGS) -- $(SRCS) |
---|
| 100 | -rm makedep.bak |
---|
| 101 | |
---|
| 102 | -include makedep |
---|
| 103 | |
---|