summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile31
1 files changed, 24 insertions, 7 deletions
diff --git a/Makefile b/Makefile
index a5652db..7ffcc73 100644
--- a/Makefile
+++ b/Makefile
@@ -8,6 +8,9 @@ SHARED_FLAGS=-dynamiclib
SHARED_EXT=dylib
LIBS=-liconv
LD = g++
+LDFLAGS_GL = -L/usr/X11/lib -lGLU -lGL -X11 -dylib_file \
+/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib:\
+/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib
else
ARCH_FLAGS=-march=i686 -m32
LDFLAGS_MESA=-u gluNewTess -Wl,--whole-archive ../Mesa-7.3/lib/libGLU.a ../Mesa-7.3/lib/libOSMesa.a -Wl,--no-whole-archive
@@ -16,6 +19,7 @@ LDFLAGS_READLINE=/usr/lib/libreadline.a /usr/lib/libncurses.a
SHARED_FLAGS=-shared
SHARED_EXT=so
LD = g++ -m32
+LDFLAGS_GL = -lGLU -lGL
endif
CC = gcc
CXX = g++
@@ -42,7 +46,7 @@ CPPFLAGS += $(INCLUDES) -g -DSTDC_HEADERS $(CPPFLAGS_READLINE) -DHOOK_STDS -fexc
BASIC_LDFLAGS = $(ARCH_FLAGS) $(LIBS)
-LDFLAGS += $(BASIC_LDFLAGS) $(LDFLAGS_READLINE) -L/usr/lib/oracle/11.1.0.1/client/lib $(LDFLAGS_MESA)
+LDFLAGS += $(BASIC_LDFLAGS) $(LDFLAGS_READLINE) -L/usr/lib/oracle/11.1.0.1/client/lib
vpath %.c ../Baltisot/lib:../Baltisot/src:../Baltisot/lib/zlib/src:../Baltisot/lib/lua/src:../Baltisot/lib/lua/src/LuaLib:src:../paperIdol/src:../mogltk/lib:../tinyxml:../lua-modules/src
vpath %.cc ../Baltisot/lib:../Baltisot/src:../Baltisot/lib/zlib/src:../Baltisot/lib/lua/src:../Baltisot/lib/lua/src/LuaLib:src:../paperIdol/src:../mogltk/lib:../tinyxml:../lua-modules/src
@@ -199,7 +203,7 @@ httplib.lua \
plugin-luaosmesa.cc \
dds.c
-WHOLE_SOURCES = $(BALTISOT_SOURCES) $(LUA_SOURCES) $(LUAINTERFACE_SOURCES)
+WHOLE_SOURCES = $(BALTISOT_SOURCES) $(LUA_SOURCES) $(LUAINTERFACE_SOURCES) gl-glue.s
DEBUG_SOURCES = $(DEBUG_MODULES)
LUAINTERFACE_OBJECTS = $(addsuffix .o, $(notdir $(basename $(LUAINTERFACE_SOURCES))))
@@ -216,17 +220,24 @@ dep: $(ALL_DEPS)
luac: $(LUAC_OBJECTS)
$(LD) -o luac $(LUAC_OBJECTS) $(BASIC_LDFLAGS)
-lua-interface.$(SHARED_EXT): $(ALL_OBJECTS)
- $(LD) $(SHARED_FLAGS) -o lua-interface.$(SHARED_EXT) $(ALL_OBJECTS) $(LDFLAGS)
+lua-interface-mesa.$(SHARED_EXT): $(ALL_OBJECTS)
+ $(LD) $(SHARED_FLAGS) -o lua-interface.$(SHARED_EXT) $(ALL_OBJECTS) $(LDFLAGS) $(LDFLAGS_MESA)
+ mv lua-interface.$(SHARED_EXT) $@
+ ln -sf $@ lua-interface.$(SHARED_EXT)
-lua-interface: lua-interface.$(SHARED_EXT) lua-interface-main.o
- $(LD) -o lua-interface ./lua-interface.$(SHARED_EXT) lua-interface-main.o
+lua-interface-gl.$(SHARED_EXT): $(ALL_OBJECTS)
+ $(LD) $(SHARED_FLAGS) -o lua-interface.$(SHARED_EXT) $(ALL_OBJECTS) $(LDFLAGS) $(LDFLAGS_GL)
+ mv lua-interface.$(SHARED_EXT) $@
+ ln -sf $@ lua-interface.$(SHARED_EXT)
+
+lua-interface: lua-interface-mesa.$(SHARED_EXT) lua-interface-main.o
+ $(LD) -o $@ ./lua-interface.$(SHARED_EXT) lua-interface-main.o
lua-interface-dbg: $(ALL_OBJECTS) $(DEBUG_OBJECTS)
$(LD) -o lua-interface-dbg $(ALL_OBJECTS) $(DEBUG_OBJECTS) $(LDFLAGS) -lfreetype -lftgl ../Mesa-7.0.3/lib/libGLU.a ../Mesa-7.0.3/lib/libOSMesa.a /usr/lib/libmysqlclient.a -locci -lclntsh `Magick++-config --libs`
clean:
- rm -f lua-interface luac *.o *.dep *.so *.dylib
+ rm -f lua-interface-mesa lua-interface-gl luac *.o *.dep *.so *.dylib
%.dep : %.c
$(CC) $(CPPFLAGS) -M -MF $@ $<
@@ -243,4 +254,10 @@ clean:
%.clua : %.lua
./luac -o $@ $<
+gl-glue.dep:
+ touch gl-glue.dep
+
+gl-glue.s:
+ src/generate-gl-glue.sh > gl-glue.s
+
-include $(ALL_DEPS)