[37] | 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 | CSRCS = |
---|
| 24 | |
---|
| 25 | CXXSRCS = main.cc getinfo.cc init.cc edge.cc cube.cc quit.cc \ |
---|
| 26 | fatal.cc slices.cc OccGridRLE.cc SectionRLE.cc \ |
---|
| 27 | ChunkAllocator.cc ChunkLink.cc OccGrid.cc |
---|
| 28 | |
---|
| 29 | TARGETS = vripmarch |
---|
| 30 | |
---|
| 31 | ROOT = ../.. |
---|
| 32 | |
---|
| 33 | # Get OS uname |
---|
| 34 | UNAME := $(shell uname) |
---|
| 35 | |
---|
| 36 | ifeq ($(UNAME), IRIX) |
---|
| 37 | |
---|
| 38 | # Set optimizer flags to allow it to run on Indys... |
---|
| 39 | ifeq ($(OPTIMIZER), -O) |
---|
| 40 | OPTIMIZER = -O -mips3 |
---|
| 41 | endif #OPTIMIZER |
---|
| 42 | |
---|
| 43 | CC = cc |
---|
| 44 | CXX = CC |
---|
| 45 | |
---|
| 46 | CFLAGS = -woff3262 -woff1174 -woff1356 |
---|
| 47 | CXXFLAGS = -woff3262 -woff1174 -woff1356 |
---|
| 48 | |
---|
| 49 | INCLS = -I. -I$(ROOT)/include |
---|
| 50 | |
---|
| 51 | LIBPATHS = -L. -L$(ROOT)/lib |
---|
| 52 | |
---|
| 53 | LIBS = -lmcfile -lply -llinear -lm -lmalloc |
---|
| 54 | |
---|
| 55 | else |
---|
| 56 | |
---|
| 57 | # Set special optimizer flags... |
---|
| 58 | ifeq ($(OPTIMIZER),-O) |
---|
| 59 | OPTIMIZER = -O6 -march=i686 -malign-double \ |
---|
| 60 | -funroll-loops -fomit-frame-pointer -ffast-math |
---|
| 61 | endif |
---|
| 62 | |
---|
| 63 | CC = gcc |
---|
| 64 | CXX = g++ |
---|
| 65 | |
---|
| 66 | CFLAGS = -DLINUX -Wall -Wno-unused |
---|
| 67 | CXXFLAGS = -DLINUX -Wall -Wno-unused |
---|
| 68 | |
---|
| 69 | INCLS = -I. -I$(ROOT)/include |
---|
| 70 | |
---|
| 71 | LIBPATHS = -L. -L$(ROOT)/lib |
---|
| 72 | |
---|
| 73 | LIBS = -lmcfile -lply -lm -lc |
---|
| 74 | |
---|
| 75 | endif |
---|
| 76 | |
---|
| 77 | |
---|
| 78 | CFLAGS := $(INCLS) -DFUNCPROTO -DHAVE_UNISTD_H $(CFLAGS) |
---|
| 79 | CXXFLAGS := $(INCLS) -DFUNCPROTO -DHAVE_UNISTD_H $(CXXFLAGS) |
---|
| 80 | CC := $(CC) $(OPTIMIZER) |
---|
| 81 | CXX := $(CXX) $(OPTIMIZER) |
---|
| 82 | |
---|
| 83 | SRCS = $(CXXSRCS) $(CSRCS) |
---|
| 84 | |
---|
| 85 | OBJS = $(CXXSRCS:.cc=.o) $(CSRCS:.c=.o) |
---|
| 86 | |
---|
| 87 | OBJ2 = fromden.o |
---|
| 88 | OBJ3 = polys.o mcfile.o |
---|
| 89 | OBJ4 = mctoply.o mcfile.o |
---|
| 90 | |
---|
| 91 | default: all |
---|
| 92 | |
---|
| 93 | all: $(TARGETS) |
---|
| 94 | |
---|
| 95 | install: clobber depend all |
---|
| 96 | |
---|
| 97 | vripmarch: $(OBJS) libmcfile.a |
---|
| 98 | $(CXX) -o $@ $(OBJS) $(LIBPATHS) $(LIBS) |
---|
| 99 | |
---|
| 100 | polys: $(OBJ3) |
---|
| 101 | $(CC) $(CFLAGS) $(C++FLAGS) $(OBJ3) -o polys $(LIBPATHS) $(LIBS) |
---|
| 102 | |
---|
| 103 | mctoply: $(OBJ4) |
---|
| 104 | $(CC) $(CFLAGS) $(C++FLAGS) $(OBJ4) -o mctoply $(LIBPATHS) $(LIBS) |
---|
| 105 | |
---|
| 106 | fromshd: $(OBJ2) |
---|
| 107 | $(CC) $(CFLAGS) -o fromshd $(OBJ2) |
---|
| 108 | |
---|
| 109 | fromden: $(OBJ2) |
---|
| 110 | $(CC) $(CFLAGS) -o fromden $(OBJ2) $(LIBPATHS) -llevden |
---|
| 111 | |
---|
| 112 | libmcfile.a: libmcfile.a(mcfile.o) |
---|
| 113 | # ranlib libmcfile.a |
---|
| 114 | |
---|
| 115 | libmcfile.a(mcfile.o): mcfile.h |
---|
| 116 | |
---|
| 117 | clean: |
---|
| 118 | -/bin/rm -f *.o *~ core |
---|
| 119 | |
---|
| 120 | clobber: |
---|
| 121 | -/bin/rm -f *.o *~ core makedep $(TARGETS) |
---|
| 122 | |
---|
| 123 | depend: |
---|
| 124 | echo > makedep |
---|
| 125 | gccmakedep -fmakedep -- $(CFLAGS) -- $(SRCS) |
---|
| 126 | rm makedep.bak |
---|
| 127 | |
---|
| 128 | -include makedep |
---|