diff options
-rw-r--r-- | Makefile | 40 | ||||
-rw-r--r-- | Makefile.mingw32 | 2 |
2 files changed, 33 insertions, 9 deletions
@@ -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 diff --git a/Makefile.mingw32 b/Makefile.mingw32 index ed3786b..96a99d9 100644 --- a/Makefile.mingw32 +++ b/Makefile.mingw32 @@ -40,7 +40,7 @@ INCLUDES = \ HAVES = -DHAVE_VSSCANF -DHAVE_LIBJPEG -DHAVE_MALLOC_H -DHAVE_BYTESWAP_H -DCD_NO_OLD_INTERFACE -DGTK_DISABLE_DEPRECATED -DIUPLUA_USELOH -DUSE_STATIC -D_WIN32_WINNT=0x0501 -D_WIN32_IE=0x0500 -DWINVER=0x0501 -CPPFLAGS += $(INCLUDES) -g -DSTDC_HEADERS -DREADLINE_STATIC -DHOOK_STDS -DWORDS_LITTLEENDIAN -fexceptions -march=i686 $(HAVES) -D__CRT_INLINE="static inline" +CPPFLAGS += $(INCLUDES) -g -DSTDC_HEADERS -DREADLINE_STATIC -DHOOK_STDS -DWORDS_LITTLEENDIAN -fexceptions -march=i686 $(HAVES) -D__CRT_INLINE="static inline" -DNDEBUG -DUSE_MGL_NAMESPACE LDFLAGS += -g -fexceptions -shared ../lua-interface/lua-interface.a -Wl,--export-dynamic -Wl,--enable-auto-image-base --export-all-symbols -Wl,--enable-auto-import \ -L ../freetype-win32/lib -L ../gnuwin32/lib |