-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
62 lines (47 loc) · 1.27 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#
# GNU Makefile for the camera_control_glut project
#
# Michael Shafae
# mshafae at fullerton.edu
#
# $Id: Makefile 4894 2014-04-07 05:08:37Z mshafae $
#
# It depends on the config.guess program that is in the config directory
# to guess what configuration to use for the build.
#
SHELL = /bin/sh
SYSTEM ?= $(shell config/config.guess | cut -d - -f 3 | sed -e 's/[0-9\.]//g;')
SYSTEM.SUPPORTED = $(shell test -f config/Makefile.$(SYSTEM) && echo 1)
ifeq ($(SYSTEM.SUPPORTED), 1)
include config/Makefile.$(SYSTEM)
else
$(error "Platform '$(SYSTEM)' not supported")
endif
TARGET = ply_viewer
# C++ Files
CXXFILES = PlyModel.cpp ply_viewer_glut.cpp
CFILES =
# Headers
HEADERS = FaceList.h PlyModel.h
OBJECTS = $(CXXFILES:.cpp=.o) $(CFILES:.c=.o)
DEP = $(CXXFILES:.cpp=.d) $(CFILES:.c=.d)
default all: $(TARGET)
$(TARGET): $(OBJECTS)
$(CXX) $(LDFLAGS) -o $(TARGET) $(OBJECTS) $(LLDLIBS)
-include $(DEP)
%.d: %.cpp
set -e; $(CXX) -MM $(CFLAGS) $< \
| sed 's/($*).o[ :]*/.o $@ : /g' > $@; \
[ -s $@ ] || rm -f $@
%.d: %.c
set -e; $(CXX) -MM $(CFLAGS) $< \
| sed 's/($*).o[ :]*/.o $@ : /g' > $@; \
[ -s $@ ] || rm -f $@
%.o: %.cpp
$(CXX) $(CFLAGS) -c $<
%.o: %.c
$(CXX) $(CFLAGS) -c $<
clean:
-rm -f $(OBJECTS) core $(TARGET).core *~
spotless: clean
-rm -f $(TARGET) $(DEP)