summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorNicolas "Pixel" Noble <pixel@nobis-crew.org>2009-12-07 18:53:27 +0100
committerNicolas "Pixel" Noble <pixel@nobis-crew.org>2009-12-07 18:53:27 +0100
commit7d9354c157c2bee357af49e5e00b6b2e200a0214 (patch)
treec46ebdab7628a26e71d00f22f59bd48666a50dda /Makefile
parentbb84387558381df7c5fa47091f541baa37a42581 (diff)
Darwin9 compilation
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile40
1 files changed, 32 insertions, 8 deletions
diff --git a/Makefile b/Makefile
index d9e5adf..d523ec9 100644
--- a/Makefile
+++ b/Makefile
@@ -1,4 +1,16 @@
+ifeq ($(SYSTEM),)
SYSTEM=$(shell uname)
+endif
+TRUESYSTEM=$(shell uname)
+MACHINE=$(shell uname -m)
+DISTRIB=$(shell cat /etc/issue | cut -f 1 -d\ | head -1)
+GL_GLUE=gl-glue.s
+CC = gcc
+CXX = g++
+LD = g++
+AS = as
+AR = ar rcs
+USR=/usr
ifeq ($(SYSTEM),Darwin)
ARCH_FLAGS=-arch i386
SHARED_FLAGS=-dynamiclib
@@ -6,6 +18,21 @@ SHARED_EXT=dylib
CPPFLAGS = -dynamic
LD = g++ -arch i386
STRIP = strip -x
+FINK=
+ifeq ($(TRUESYSTEM),Linux)
+CC = i686-apple-darwin9-gcc
+CXX = i686-apple-darwin9-g++
+LD = i686-apple-darwin9-g++ -arch i386
+STRIP = i686-apple-darwin9-strip -x
+AS = i686-apple-darwin9-as -arch i386
+LIPO = i686-apple-darwin9-lipo
+AR = i686-apple-darwin9-ar rcs
+ARCH_FLAGS =
+LDFLAGS_MESA = -all_load ../Mesa-7.4.4-darwin9/lib/libGLU.a ../Mesa-7.4.4-darwin
+LUAJIT = ../LuaJIT-darwin9/src/libluajit.a
+USR=/usr/i686-apple-darwin9
+FINK=$(USR)
+endif
else
ARCH_FLAGS=-march=i686 -m32
SHARED_FLAGS=-shared
@@ -13,25 +40,22 @@ SHARED_EXT=so
LD = g++ -m32
STRIP = strip --strip-unneeded
endif
-CC = gcc
-CXX = g++
-AR = ar rcs
INCLUDES = \
-I../Baltisot/include \
-I../LuaJIT/src \
--I /usr/include/freetype2 \
--I /sw/include \
--I /usr/X11/include/freetype2 -I /usr/X11/include \
+-I $(USR)/include/freetype2 \
+-I $(FINK)/sw/include \
+-I $(USR)/X11/include/freetype2 -I $(USR)/X11/include \
-I /usr/include/gtk-2.0 -I /usr/include/glib-2.0 -I /usr/lib/glib-2.0/include -I /usr/include/cairo -I /usr/include/pango-1.0 -I /usr/lib/gtk-2.0/include -I /usr/include/atk-1.0 \
-I im/include -I cd/include -I cd/src/sim -I cd/src/x11 -I iup/include -I iup/src -I iup/srccontrols \
HAVES = -DHAVE_VSSCANF -DHAVE_LIBJPEG -DHAVE_FCNTL -DHAVE_UNISTD_H -DHAVE_FORK -DHAVE_PIPE -DHAVE_FSYNC -DHAVE_MALLOC_H -DHAVE_ASPRINTF -DHAVE_BYTESWAP_H -DCD_NO_OLD_INTERFACE -DGTK_DISABLE_DEPRECATED -DIUPLUA_USELOH -DUSE_STATIC
-CPPFLAGS_NO_ARCH += $(INCLUDES) -O4 -fexceptions -DSTDC_HEADERS -DREADLINE_STATIC -DHOOK_STDS -DWORDS_LITTLEENDIAN $(HAVES) -DTEC_LITTLEENDIAN -g
+CPPFLAGS_NO_ARCH += $(INCLUDES) -O4 -fexceptions -DSTDC_HEADERS -DREADLINE_STATIC -DHOOK_STDS -DWORDS_LITTLEENDIAN $(HAVES) -DTEC_LITTLEENDIAN -g -DNDEBUG -DUSE_MGL_NAMESPACE
CPPFLAGS += $(CPPFLAGS_NO_ARCH) $(ARCH_FLAGS)
-LDFLAGS += $(ARCH_FLAGS) $(SHARED_FLAGS) -L/usr/X11/lib -L/sw/lib ./lua-interface.$(SHARED_EXT)
+LDFLAGS += $(ARCH_FLAGS) $(SHARED_FLAGS) -L$(USR)/X11/lib -L$(FINK)/sw/lib ./lua-interface.$(SHARED_EXT)
vpath %.c ../Baltisot/lib:../Baltisot/src:src:im/src:im/src/process:im/src/lua5:cd/src:cd/src/intcgm:cd/src/drv:cd/src/sim:cd/src/x11:cd/src/xrender:cd/src/lua5:iup/src:iup/src/mot:iup/src/gtk:iup/srccd:iup/srccontrols:iup/srccontrols/color:iup/srccontrols/matrix:iup/srcim:iup/srcledc:iup/srclua5
vpath %.cc ../Baltisot/lib:../Baltisot/src:src:im/src:im/src/process:im/src/lua5:cd/src:cd/src/intcgm:cd/src/drv:cd/src/sim:cd/src/x11:cd/src/xrender:cd/src/lua5:iup/src:iup/src/mot:iup/src/gtk:iup/srccd:iup/srccontrols:iup/srccontrols/color:iup/srccontrols/matrix:iup/srcim:iup/srcledc:iup/srclua5