-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
35 lines (28 loc) · 995 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
OSNAME := $(shell uname -s)
DUKTAPE_DIR := ../duktape-1.3.0
RENGINE_DIR := ../rengine
INCLUDES := -I$(RENGINE_DIR)/include -I$(RENGINE_DIR)/3rdparty -I/usr/local/include/SDL2 -I$(DUKTAPE_DIR)/src
DEFINES := -DRENGINE_OPENGL_DESKTOP -DRENGINE_BACKEND_SDL
CFLAGS := -g
CXXFLAGS := -std=c++11
ifeq ($(OSNAME),Darwin)
OS := =osx
CXX := clang++
CC := clang
LFLAGS := -framework OpenGL -L/usr/local/lib -lSDL2
else
OS := linux
CXX := g++
CC := gcc
LFLAGS :=
endif
all: renginejs
renginejs: duktape.o main.o
$(CXX) duktape.o main.o -o renginejs $(LFLAGS)
duktape.o: $(DUKTAPE_DIR)/src/duktape.c
$(CC) -c $(CFLAGS) $(INCLUDES) $(DEFINES) $(DUKTAPE_DIR)/src/duktape.c -o duktape.o
main.o: main.cpp *.h
$(CXX) -c $(CFLAGS) $(CXXFLAGS) $(INCLUDES) $(DEFINES) main.cpp -o main.o
clean:
rm -f *.o
rm -f jsrengine