Lunatic: fix up Makefiles, split dynsymlists.

The Makefile now has separate {GAME,EDITOR}LDFLAGS, so the correct
dynamic symbol list can be specified.

git-svn-id: https://svn.eduke32.com/eduke32@3057 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
helixhorned 2012-10-07 15:25:58 +00:00
parent 851c6b081d
commit f9e61ce37e
4 changed files with 69 additions and 18 deletions

View file

@ -43,6 +43,9 @@ OURCONLYFLAGS=$(BASECONLYFLAGS)
OURASFLAGS=$(BASEASFLAGS)
OURLDFLAGS=$(BASELDFLAGS) $(BUILDLDFLAGS)
# Game/editor-specific linker options
GAMELDFLAGS=
EDITORLDFLAGS=
JAUDIOLIBDIR=$(SRC)/jaudiolib
JAUDIOLIB=libjfaudiolib.a
@ -123,7 +126,7 @@ GAMEOBJS=$(OBJ)/game.$o \
$(OBJ)/osdcmds.$o \
$(OBJ)/grpscan.$o \
$(OBJ)/sounds.$o \
$(OBJ)/xdelta3.$o \
$(OBJ)/xdelta3.$o \
$(JMACTOBJ)
EDITOROBJS=$(OBJ)/astub.$o \
@ -149,8 +152,6 @@ LUAJIT=luajit
LUAJIT_WIN_SRC:= g:/mod/LuaJIT-2.0.0-beta8/src
ifneq (0,$(LUNATIC))
# TODO: pass these flags only when building EDuke32, not Mapster32
ifeq ($(PLATFORM),WINDOWS)
OURCFLAGS+= -I$(LUAJIT_WIN_SRC)
else
@ -193,7 +194,9 @@ ifneq (0,$(LUNATIC))
OURLDFLAGS+= $(SRC)/lunatic/eduke32.def
endif
ifeq ($(PLATFORM),LINUX)
OURLDFLAGS+= -Wl,--dynamic-list=$(SRC)/lunatic/dynsymlist
# TODO: Windows, OS X
GAMELDFLAGS+= -Wl,--dynamic-list=$(SRC)/lunatic/dynsymlist
EDITORLDFLAGS+= -Wl,--dynamic-list=$(SRC)/lunatic/dynsymlist_m32
endif
endif
@ -336,7 +339,7 @@ notice:
eduke32$(EXESUFFIX): $(GAMEOBJS) $(EOBJ)/$(ENGINELIB) $(JAUDIOLIBDIR)/$(JAUDIOLIB) $(ENETDIR)/$(ENETLIB) $(MISCGAMEDEPS)
$(LINK_STATUS)
if $(CC) $(OURCONLYFLAGS) $(OURCFLAGS) -o $@ $^ $(OURLDFLAGS) $(LIBS) $(STATICSTDCPP) $(STDCPPLIB); then $(LINK_OK); else $(LINK_FAILED); fi
if $(CC) $(OURCONLYFLAGS) $(OURCFLAGS) -o $@ $^ $(OURLDFLAGS) $(GAMELDFLAGS) $(LIBS) $(STATICSTDCPP) $(STDCPPLIB); then $(LINK_OK); else $(LINK_FAILED); fi
ifeq (1,$(RELEASE))
ifeq (0,$(DEBUGANYWAY))
ifneq ($(PLATFORM),WII)
@ -352,7 +355,7 @@ endif
mapster32$(EXESUFFIX): $(EDITOROBJS) $(EOBJ)/$(EDITORLIB) $(EOBJ)/$(ENGINELIB) $(JAUDIOLIBDIR)/$(JAUDIOLIB)
$(LINK_STATUS)
if $(CC) $(OURCONLYFLAGS) $(OURCFLAGS) -o $@ $^ $(OURLDFLAGS) $(LIBS) $(STATICSTDCPP) $(STDCPPLIB); then $(LINK_OK); else $(LINK_FAILED); fi
if $(CC) $(OURCONLYFLAGS) $(OURCFLAGS) -o $@ $^ $(OURLDFLAGS) $(EDITORLDFLAGS) $(LIBS) $(STATICSTDCPP) $(STDCPPLIB); then $(LINK_OK); else $(LINK_FAILED); fi
ifeq (1,$(RELEASE))
ifeq (0,$(DEBUGANYWAY))
ifneq ($(PLATFORM),WII)
@ -401,6 +404,7 @@ endif
# RULES
$(EBACKTRACEDLL): Windows/src/backtrace.c
if $(CC) -O2 -shared -Wall -Wextra -I$(EINC) -o $@ $^ -lbfd -liberty -limagehlp; then $(COMPILE_OK); else $(COMPILE_FAILED); fi
@ -412,6 +416,8 @@ $(OBJ)/%.$o: $(SRC)/%.c
$(COMPILE_STATUS)
if $(CC) $(OURCONLYFLAGS) $(OURCFLAGS) -c $< -o $@; then $(COMPILE_OK); else $(COMPILE_FAILED); fi
#### Lunatic
# Create object files directly with luajit
$(OBJ)/luaJIT_BC_%.$o: $(SRC)/lunatic/%.lua
$(COMPILE_STATUS)
@ -431,16 +437,22 @@ $(OBJ)/%.$o: $(SRC)/xdelta3/%.c
$(COMPILE_STATUS)
if $(CC) $(OURCONLYFLAGS) $(OURCFLAGS) -c $< -o $@; then $(COMPILE_OK); else $(COMPILE_FAILED); fi
# TODO: _m32
# List of exported symbols, OS X
$(SRC)/lunatic/dynsymlist_osx: $(SRC)/lunatic/dynsymlist
sed 's/[{};]//g;s/[A-Za-z_][A-Za-z_0-9]*/_&/g' $< > $@
$(SRC)/lunatic/aliases_list: $(SRC)/lunatic/dynsymlist_osx
sed 's/_\([A-Za-z_][A-Za-z_0-9]*\)/_\1 \1/g' $< > $@
#$(SRC)/lunatic/aliases_list: $(SRC)/lunatic/dynsymlist_osx
# sed 's/_\([A-Za-z_][A-Za-z_0-9]*\)/_\1 \1/g' $< > $@
# TODO: _m32
# List of exported symbols, Windows
$(SRC)/lunatic/eduke32.def: $(SRC)/lunatic/dynsymlist
echo EXPORTS > $@
sed 's/[{};]//g' $< >> $@
####
$(OBJ)/%.$o: Apple/%.m
$(COMPILE_STATUS)
if $(CC) $(OURCONLYFLAGS) $(OURCFLAGS) -c $< -o $@; then $(COMPILE_OK); else $(COMPILE_FAILED); fi

View file

@ -57,7 +57,9 @@ $(OBJ)/osdfuncs.$o: $(SRC)/names.h $(EINC)/build.h $(EINC)/osd.h
$(OBJ)/osdcmds.$o: $(SRC)/osdcmds.c $(INC)/osdcmds.h $(EINC)/osd.h $(duke3d_h)
$(OBJ)/xdelta3.$o: $(SRC)/xdelta3/xdelta3.c $(SRC)/xdelta3/xdelta3.h
$(OBJ)/animvpx.$o: $(SRC)/animvpx.c $(SRC)/animvpx.h $(duke3d_h) $(EINC)/glbuild.h
$(OBJ)/lunatic/lunatic.$o: $(SRC)/lunatic/lunatic.c $(SRC)/lunatic/lunatic.h $(EINC)/cache1d.h $(EINC)/osd.h
$(OBJ)/lunatic.$o: $(SRC)/lunatic/lunatic.c $(SRC)/lunatic/lunatic.h $(SRC)/lunatic/lunatic_priv.h $(EINC)/cache1d.h $(EINC)/osd.h
$(OBJ)/lunatic_m32.$o: $(SRC)/lunatic/lunatic_m32.c $(SRC)/lunatic/lunatic_m32.h $(SRC)/lunatic/lunatic_priv.h $(EINC)/cache1d.h $(EINC)/osd.h
# editor objects
m32_script_hs=$(EINC)/m32script.h $(SRC)/m32def.h

View file

@ -2,9 +2,6 @@
engine_main_arrays_are_static;
engine_v8;
g_sizes_of_what;
g_sizes_of;
sector;
wall;
sprite;
@ -30,15 +27,22 @@ nextspritestat;
headsectbunch;
nextsectbunch;
ksqrt;
hitscan;
rotatesprite;
gethitickms;
g_sizes_of_what;
g_sizes_of;
kopen4loadfrommod;
kfilelength;
kclose;
kread;
ksqrt;
hitscan;
rotatesprite;
actor;
ud;
g_player;
@ -56,6 +60,4 @@ luaJIT_BC_control;
rand_jkiss_u32;
rand_jkiss_dbl;
md4once;
gethitickms;
};

View file

@ -0,0 +1,35 @@
{
engine_main_arrays_are_static;
engine_v8;
sector;
wall;
sprite;
spriteext;
numsectors;
numwalls;
numyaxbunches;
totalclock;
xdim;
ydim;
yax_getbunch;
headspritesect;
headspritestat;
prevspritesect;
prevspritestat;
nextspritesect;
nextspritestat;
headsectbunch;
nextsectbunch;
ksqrt;
hitscan;
rotatesprite;
gethitickms;
};