-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
executable file
·55 lines (45 loc) · 894 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
45
46
47
48
49
50
51
52
53
54
55
UNAME = $(shell uname)
objects = main.o \
model-iqm.o\
model-iqe.o\
shader.o \
image.o \
vector.o \
unit.o \
utils.o
ifeq ($(UNAME), Linux)
objects += strlcpy.o
endif
sources = main.c \
model-iqm.c\
model-iqe.c\
image.c \
shader.c \
strlcpy.c \
vector.c \
unit.c \
utils.c
ifeq ($(UNAME), Linux)
sources += strlcpy.c
endif
CFLAGS =
ifeq ($(UNAME), Darwin)
CFLAGS += -m32 -Wall
endif
CFLAGS += -I. -I/usr/X11/include -I/usr/local/include
CFLAGS += -g -fno-omit-frame-pointer -I.
LDFLAGS = -L/usr/local/lib -L/usr/X11/lib
ifeq ($(UNAME), Linux)
LDFLAGS += -ljpeg -lm -lglut -lGLEW -lGLU -lGL -lc
endif
ifeq ($(UNAME), Darwin)
LDFLAGS += -framework OpenGL -framework GLUT
endif
all: objview
objview: $(objects)
gcc $(CFLAGS) -o objview $(objects) $(LDFLAGS)
%.o : %.c $(wildcard *.h)
gcc $(CFLAGS) -c $<
clean:
rm -f objview
rm -f *.o*