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 | CXXREGFILES = verify.cc |
---|
24 | |
---|
25 | CXXLIBFILES = Vec3f.cc Matrix2f.cc Matrix3f.cc Matrix4f.cc \ |
---|
26 | Quaternion.cc |
---|
27 | |
---|
28 | CXXFILES = $(CXXREGFILES) $(CXXLIBFILES) |
---|
29 | |
---|
30 | CFILES = |
---|
31 | |
---|
32 | TARGETS = liblinear.a verify |
---|
33 | |
---|
34 | ROOT = ../.. |
---|
35 | |
---|
36 | # Get OS uname |
---|
37 | UNAME := $(shell uname) |
---|
38 | |
---|
39 | ifeq ($(UNAME), IRIX) |
---|
40 | |
---|
41 | # Set optimizer flags to allow it to run on Indys... |
---|
42 | ifeq ($(OPTIMIZER), -O) |
---|
43 | OPTIMIZER = -O -mips3 |
---|
44 | endif #OPTIMIZER |
---|
45 | |
---|
46 | CC = cc |
---|
47 | CXX = CC |
---|
48 | |
---|
49 | CFLAGS = -D_BOOL -woff3262 -woff1174 |
---|
50 | CXXFLAGS = -D_BOOL -woff3262 -woff1174 |
---|
51 | |
---|
52 | INCLS = -I. -I$(ROOT)/include |
---|
53 | |
---|
54 | LIBPATHS = -L. -L$(ROOT)/lib |
---|
55 | |
---|
56 | else |
---|
57 | |
---|
58 | # Set special optimizer flags... |
---|
59 | ifeq ($(OPTIMIZER),-O) |
---|
60 | OPTIMIZER = -O6 -march=i686 -malign-double -fno-for-scope \ |
---|
61 | -funroll-loops -fomit-frame-pointer -ffast-math |
---|
62 | endif |
---|
63 | |
---|
64 | CC = gcc |
---|
65 | CXX = g++ |
---|
66 | |
---|
67 | CFLAGS = -DLINUX -Wall -D_BOOL -Wno-unused \ |
---|
68 | -Wmissing-declarations |
---|
69 | CXXFLAGS = -DLINUX -Wall -D_BOOL -Wno-unused |
---|
70 | |
---|
71 | INCLS = -I. -I$(ROOT)/include |
---|
72 | |
---|
73 | LIBPATHS = -L. -L$(ROOT)/lib |
---|
74 | |
---|
75 | endif |
---|
76 | |
---|
77 | SRCS = $(CXXREGFILES) $(CXXLIBFILES) $(CXXFILES) $(CFILES) |
---|
78 | |
---|
79 | # C++ object files |
---|
80 | CXXOBJS = $(CXXFILES:.cc=.o) |
---|
81 | CXXLIBOBJS = $(CXXLIBFILES:.cc=.o) |
---|
82 | |
---|
83 | COBJS = $(CFILES:.c=.o) |
---|
84 | |
---|
85 | CFLAGS := $(INCLS) -DFUNCPROTO -DHAVE_UNISTD_H $(CFLAGS) |
---|
86 | CXXFLAGS := $(INCLS) -DFUNCPROTO -DHAVE_UNISTD_H $(CXXFLAGS) |
---|
87 | CC := $(CC) $(OPTIMIZER) |
---|
88 | CXX := $(CXX) $(OPTIMIZER) |
---|
89 | |
---|
90 | CXXLLDLIBS = -L. -L$(ROOT)/lib -llinear -lc -lm |
---|
91 | |
---|
92 | default: all |
---|
93 | |
---|
94 | all: $(TARGETS) |
---|
95 | |
---|
96 | install: clobber depend all |
---|
97 | |
---|
98 | liblinear.a: $(CXXLIBOBJS) |
---|
99 | ar -rc liblinear.a $(CXXLIBOBJS) |
---|
100 | |
---|
101 | verify: verify.o liblinear.a |
---|
102 | $(CXX) -o $@ verify.o $(CXXLLDLIBS) |
---|
103 | |
---|
104 | clean: |
---|
105 | -/bin/rm -f *.o *~ core |
---|
106 | |
---|
107 | clobber: |
---|
108 | -/bin/rm -f *.o *~ core makedep $(TARGETS) |
---|
109 | |
---|
110 | depend: |
---|
111 | echo > makedep |
---|
112 | gccmakedep -fmakedep -- $(CFLAGS) -- $(SRCS) |
---|
113 | -rm makedep.bak |
---|
114 | |
---|
115 | -include makedep |
---|
116 | |
---|