File polly-b-gone-02-Makefile.patch of Package polly-b-gone

#
# Patch file from Gentoo's ebuild (Bugzilla 263965)
# 
# By Piotr Szymaniak <lazy_bum@o2.pl>
diff -Naur polly-src.old/Makefile polly-src/Makefile
--- polly-src.old/Makefile	2008-12-05 09:09:00.000000000 +0100
+++ polly-src/Makefile	2009-03-27 18:35:21.000000000 +0100
@@ -1,3 +1,6 @@
+MACHINE= $(shell uname -s)
+
+ifeq ($(MACHINE),Darwin)
 CXXFLAGS = \
 	-O2 \
 	-I/System/Library/Frameworks/GLUT.framework/Headers \
@@ -25,7 +28,28 @@
 	resources/*.vert \
 	resources/world.xml
 
+else
+LIBS = \
+	`sdl-config --cflags` \
+	-I/usr/include \
+	-lGLU \
+	-lGL \
+	-lGLEW \
+	-lglut \
+	-lSDL \
+	-lSDL_image \
+	-lSDL_mixer \
+	-ltinyxml
+
+endif
+
+ifeq ($(MACHINE),Darwin)
 all : obj/Polly-B-Gone.app
+else
+all : obj/polly-b-gone
+endif
+
+ifeq ($(MACHINE),Darwin)
 
 obj/main.out : \
 	obj/ball.o \
@@ -66,6 +90,48 @@
 	obj/worlds.o \
 	SDLMain.m
 
+else
+
+obj/main.out : \
+	obj/ball.o \
+	obj/block.o \
+	obj/escalator.o \
+	obj/fan.o \
+	obj/lighting.o \
+	obj/material.o \
+	obj/model.o \
+	obj/physics/constraint.o \
+	obj/physics/force.o \
+	obj/physics/particle.o \
+	obj/physics/rotation.o \
+	obj/physics/shape.o \
+	obj/physics/transform.o \
+	obj/physics/translation.o \
+	obj/physics/vector.o \
+	obj/player.o \
+	obj/portal.o \
+	obj/ramp.o \
+	obj/resource.o \
+	obj/room.o \
+	obj/room_force.o \
+	obj/room_object.o \
+	obj/rotating.o \
+	obj/seesaw.o \
+	obj/shader.o \
+	obj/simulation.o \
+	obj/sound.o \
+	obj/switch.o \
+	obj/texture.o \
+	obj/trail.o \
+	obj/transforming.o \
+	obj/translating.o \
+	obj/tube.o \
+	obj/wall.o \
+	obj/world.o \
+	obj/worlds.o 
+
+endif
+
 obj/physics/particle_test.out : \
 	obj/physics/force.o \
 	obj/physics/particle.o \
@@ -79,6 +145,8 @@
 obj/physics/vector_test.out : \
 	obj/physics/vector.o
 
+ifeq ($(MACHINE),Darwin)
+
 obj/Polly-B-Gone.app : obj/main.out $(RESOURCES) resources/Info.plist Makefile
 	rm -rf $@
 	mkdir -p $@/Contents/MacOS
@@ -94,6 +162,11 @@
 	find $@/Contents/Frameworks -name Headers | xargs rm -r
 #	ln -sf ../../../../resources/world.xml $@/Contents/Resources/world.xml
 
+else
+obj/polly-b-gone : obj/main.out
+	mv obj/main.out polly-b-gone
+endif
+
 physics/%.run : obj/physics/%.out
 	./$<
 
@@ -101,7 +174,7 @@
 	./$<
 
 obj/%.out : obj/%.o
-	$(CXX) $(LDFLAGS) -o $@ $^
+	$(CXX) $(CXXFLAGS) $(LDFLAGS) -o $@ $^ $(LIBS)
 
 obj/%.o : %.cpp
 	mkdir -p $(@D)