=== added file 'Makefile'
@@ -0,0 +1,24 @@
+INSTALL = install -D
+INSTALL_DATA = $(INSTALL) -m644
+
+PKG_DEPS = sdl gl glu
+PKG_LIBS = $(shell pkg-config --libs $(PKG_DEPS))
+PKG_CFLAGS = $(shell pkg-config --cflags $(PKG_DEPS))
+
+ALL_CFLAGS = -Wall -g -O2 $(CFLAGS) $(PKG_CFLAGS)
+ALL_DEFINES = -DGLMARK_DATA_PATH=\"$(GLMARK_DATA_PATH)\" $(DEFINES)
+
+SRCS = $(wildcard *.cpp)
+OBJS = $(SRCS:.cpp=.o)
+
+.cpp.o:
+ $(CXX) $(ALL_CFLAGS) $(ALL_DEFINES) -c $< -o $@
+
+glmark: $(OBJS)
+ $(CXX) -o glmark $(LDFLAGS) $(PKG_LIBS) $(OBJS)
+
+install: glmark
+ $(INSTALL) glmark $(DESTDIR)/usr/bin/glmark
+
+clean:
+ -rm glmark $(OBJS)
=== removed file 'makefile'
@@ -1,2 +0,0 @@
-all:
- g++ *.cpp -o glmark -Wall -lSDL -lGL -lGLU
=== modified file 'scenebuild.cpp'
@@ -4,7 +4,7 @@
{
Model model;
- if(!model.load_3ds("data/models/horse.3ds"))
+ if(!model.load_3ds(GLMARK_DATA_PATH"data/models/horse.3ds"))
return 0;
model.calculate_normals();
=== modified file 'sceneshading.cpp'
@@ -8,7 +8,7 @@
{
Model model;
- if(!model.load_3ds("data/models/cat.3ds"))
+ if(!model.load_3ds(GLMARK_DATA_PATH"data/models/cat.3ds"))
return 0;
model.calculate_normals();
@@ -16,8 +16,10 @@
mMesh.build_vbo();
- mShader[0].load("data/shaders/light-basic.vert", "data/shaders/light-basic.frag");
- mShader[1].load("data/shaders/light-advanced.vert", "data/shaders/light-advanced.frag");
+ mShader[0].load(GLMARK_DATA_PATH"data/shaders/light-basic.vert",
+ GLMARK_DATA_PATH"data/shaders/light-basic.frag");
+ mShader[1].load(GLMARK_DATA_PATH"data/shaders/light-advanced.vert",
+ GLMARK_DATA_PATH"data/shaders/light-advanced.frag");
mRotationSpeed = 36.0f;
mRotation = 0.0f;
=== modified file 'scenetexture.cpp'
@@ -10,10 +10,10 @@
{
Model model;
- if(!model.load_3ds("data/models/cube.3ds"))
+ if(!model.load_3ds(GLMARK_DATA_PATH"data/models/cube.3ds"))
return 0;
- if(!load_texture("data/textures/crate-base.bmp", mTexture))
+ if(!load_texture(GLMARK_DATA_PATH"data/textures/crate-base.bmp", mTexture))
return 0;
model.calculate_normals();