View Single Post
Re: can't make the hpb bot template compile
Old
  (#5)
Whistler
Summoner
 
Whistler's Avatar
 
Status: Offline
Posts: 1,499
Join Date: Feb 2004
Location: Mist Village
Default Re: can't make the hpb bot template compile - 05-10-2004

this may be a better way:

Makefile: (for both Windows and GNU/Linux)
PHP Code:
CPP=g++
CC=gcc

#OS=linux
OS=windows

OBJ
=bot.o bot_ai.o bot_chat.o bot_client.o bot_combat.o bot_globals.o bot_navigate.o bot_sounds.o compress.o cstrike.o dllapi.o engine_api.o h_export.o linkgame.o meta_api.o namefunc.o util.o waypoint.o

CCOPT 
= -march=i586 -O6 -ffast-math -funroll-loops \
    -
fomit-frame-pointer -fexpensive-optimizations -falign-loops=\
    -
falign-jumps=-falign-functions=-fno-rtti -s

CCDEBUG 
= -ggdb3

CFLAGS 
= $(CCOPT) -I./hlsdk -I./metamod
#CFLAGS = $(CCDEBUG) -I./hlsdk -I./metamod

ifeq "$(OS)" "linux"

BASEFLAGS=-Dstricmp=strcasecmp -Dstrcmpi=strcasecmp -w
CPPFLAGS
=${BASEFLAGS} ${CFLAGS}

podbot_i586.so:    ${OBJ}
    ${
CPP} -fPIC -shared -$@ ${OBJ} -ldl -lm

clean
:
    -
rm -*.o
    
-rm -f podbot_i586.so

else

BASEFLAGS=-w
CPPFLAGS
=${BASEFLAGS} ${CFLAGS}

PODBot.dll:    ${OBJ}
    
dllwrap -mwindows --add-stdcall-alias ${OBJ} --driver-name g++ -o PODBot.dll
    strip 
-s PODBot.dll

clean
:
    -
del *.o
    
-del podbot.dll

endif

%.
o:    %.cpp
    
${CPP} ${CPPFLAGS} -$< -$@

%.
o:    %.c
    
${CC} ${CPPFLAGS} -$< -$@ 
in h_export.cpp file:
PHP Code:
void DLLEXPORT GiveFnptrsToDllenginefuncs_tpengfuncsFromEngineglobalvars_t *pGlobals )

and in bot.h file:
PHP Code:
extern "C" EXPORT void DLLEXPORT GiveFnptrsToDll(enginefuncs_t *pengfuncsFromEngineglobalvars_t *pGlobals); 
  
Reply With Quote