-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
executable file
·44 lines (37 loc) · 987 Bytes
/
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
################################################################################################
#
# Alyssa Biasi
#
################################################################################################
UNAME := $(shell uname)
DEBUG = -g
#OPTIMISE = -O3
CFLAGS = `sdl-config --cflags` $(DEBUG) $(OPTIMISE)
LDFLAGS = `sdl-config --libs` -lGL -lGLU -lglut -lm
MACSDL =
EXE = render
OBJECTS = assignment1.o sdlbase.o sphere.o torus.o grid.o utils.o
# OS X
ifeq "$(UNAME)" "Darwin"
CFLAGS =
LDFLAGS = -framework Carbon -framework GLUT \
-framework SDL -framework OpenGL \
-framework cocoa -lz
MACSDL = SDLMain.m
endif
#default target
all: $(EXE)
#executable
$(EXE) : $(OBJECTS)
gcc -o $@ $(LDFLAGS) $(MACSDL) $(OBJECTS)
#general object file rule
%.o : %.c
gcc -c -o $@ $(CFLAGS) $<
#additional dependencies
sdlbase.o : sdlbase.h
tute-vbo.o : sdlbase.h
utils.o : utils.h
#clean (-f stops error if files don't exist)
clean:
rm -f $(EXE) \
$(OBJECTS)