-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
31 lines (27 loc) · 1.04 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
CC = g++
ifeq ($(shell sw_vers 2>/dev/null | grep Mac | awk '{ print $$2}'),Mac)
CFLAGS = -g -DGL_GLEXT_PROTOTYPES -I./include/ -I/usr/X11/include -DOSX
LDFLAGS = -framework GLUT -framework OpenGL \
-L"/System/Library/Frameworks/OpenGL.framework/Libraries" \
-lGL -lGLU -lm -lstdc++
else
CFLAGS = -g -DGL_GLEXT_PROTOTYPES -Iglut-3.7.6-bin
LDFLAGS = -lglut -lGLU
endif
RM = /bin/rm -f
all: main
main: as4.o ColorAndVector.o Geometry.o
@echo Compiling executable! ./as4
@$(CC) $(CFLAGS) -o as4 as4.o ColorAndVector.o Geometry.o $(LDFLAGS)
as4.o: src/as4.cpp src/ColorAndVector.h src/Geometry.h
@echo Compiling src/as4.cpp
@$(CC) $(CFLAGS) -c src/as4.cpp -o as4.o
Geometry.o: src/Geometry.cpp src/Geometry.h src/ColorAndVector.h
@echo Compiling src/Geometry.cpp
@$(CC) $(CFLAGS) -c src/Geometry.cpp -o Geometry.o $(LDFLAGS)
ColorAndVector.o: src/ColorAndVector.cpp src/ColorAndVector.h
@echo Compiling src/ColorAndVector.cpp
@$(CC) -c src/ColorAndVector.cpp -o ColorAndVector.o
clean:
@echo Cleaning up *.o and ./as4
@$(RM) *.o as4