-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
56 lines (39 loc) · 1.05 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
#
# Cross Platform Makefile
# Compatible with Ubuntu 14.04.1 and Mac OS X
#
#CXX = g++
#CC = gcc
EXE = 3D_Signed_Distance_Shapes_Demo
OBJS = main.o
UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S), Linux) #LINUX
ECHO_MESSAGE = "Linux"
LIBS = -lglut -lGL -lX11 -lm
#CXXFLAGS = -I../../ `pkg-config --cflags glut`
#CXXFLAGS += -Wall -Wformat
CFLAGS = $(CXXFLAGS)
endif
ifeq ($(UNAME_S), Darwin) #APPLE
ECHO_MESSAGE = "Mac OS X"
LIBS = -framework OpenGL -framework Cocoa -framework IOKit -framework CoreVideo
LIBS += -L/usr/local/lib -lglut
CXXFLAGS = -I../../ -I/usr/local/include
#CXXFLAGS += -Wall -Wformat
CFLAGS = $(CXXFLAGS)
endif
ifeq ($(UNAME_S), MINGW64_NT-6.3)
ECHO_MESSAGE = "Windows"
LIBS = -lglut32 -lglew32 -lgdi32 -lopengl32 -limm32
#CXXFLAGS = -I../../ -I../libs/glut `pkg-config --cflags glut`
#CXXFLAGS += -Wall -Wformat
CFLAGS = $(CXXFLAGS)
endif
.c.o:
$(CC) $(CFLAGS) -c -o $@ $<
all: $(EXE)
@echo Build complete for $(ECHO_MESSAGE)
$(EXE): $(OBJS)
$(CC) -o $(EXE) $(OBJS) $(CFLAGS) $(LIBS)
clean:
rm $(EXE) $(OBJS)