Browse Source

Merge pull request #8 from MyLittleRobo/fixes

Add README.md. Some fixes for FreeBSD. Add Makefile for client
wantedhl
Alibek Omarov 8 years ago committed by GitHub
parent
commit
4bc44119f3
  1. 27
      README.md
  2. 89
      cl_dll/Makefile
  3. 20
      dlls/Makefile
  4. 2
      dlls/nodes.cpp

27
README.md

@ -0,0 +1,27 @@
# Half-Life SDK for Xash3D
Half-Life SDK for Xash3D with some fixes.
## How to build
### Windows
TODO
### Linux
TODO
### OS X
TODO
### FreeBSD
```
cd dlls
gmake CXX=clang++ CC=clang
cd ../cl_dll
gmake CXX=clang++ CC=clang
```

89
cl_dll/Makefile

@ -0,0 +1,89 @@
CC?=gcc
CXX?=g++
SRCS+=../dlls/crossbow.cpp
SRCS+=../dlls/crowbar.cpp
SRCS+=../dlls/egon.cpp
SRCS+=./ev_hldm.cpp
SRCS+=../dlls/gauss.cpp
SRCS+=../dlls/handgrenade.cpp
SRCS+=./hl/hl_baseentity.cpp
SRCS+=./hl/hl_events.cpp
SRCS+=./hl/hl_objects.cpp
SRCS+=./hl/hl_weapons.cpp
SRCS+=../dlls/glock.cpp
SRCS+=../dlls/hornetgun.cpp
#SRCS+=../common/interface.cpp
SRCS+=../dlls/mp5.cpp
SRCS+=../dlls/python.cpp
SRCS+=../dlls/rpg.cpp
SRCS+=../dlls/satchel.cpp
SRCS+=../dlls/shotgun.cpp
SRCS+=../dlls/squeakgrenade.cpp
SRCS+=../dlls/tripmine.cpp
#SRCS+=../game_shared/voice_banmgr.cpp
#SRCS+=../game_shared/voice_status.cpp
SRCS+=./ammo.cpp
SRCS+=./ammo_secondary.cpp
SRCS+=./ammohistory.cpp
SRCS+=./battery.cpp
SRCS+=./cdll_int.cpp
SRCS+=./com_weapons.cpp
SRCS+=./death.cpp
SRCS+=./demo.cpp
SRCS+=./entity.cpp
SRCS+=./ev_common.cpp
SRCS+=./events.cpp
SRCS+=./flashlight.cpp
SRCS+=./GameStudioModelRenderer.cpp
SRCS+=./geiger.cpp
SRCS+=./health.cpp
SRCS+=./hud.cpp
SRCS+=./hud_msg.cpp
SRCS+=./hud_redraw.cpp
#SRCS+=./hud_servers.cpp
SRCS+=./hud_spectator.cpp
SRCS+=./hud_update.cpp
SRCS+=./in_camera.cpp
SRCS+=./input.cpp
#SRCS+=./inputw32.cpp
SRCS+=./menu.cpp
SRCS+=./message.cpp
SRCS+=./overview.cpp
SRCS+=./parsemsg.cpp
SRCS_C+=../pm_shared/pm_debug.c
SRCS_C+=../pm_shared/pm_math.c
SRCS_C+=../pm_shared/pm_shared.c
SRCS+=./saytext.cpp
SRCS+=./status_icons.cpp
SRCS+=./statusbar.cpp
SRCS+=./studio_util.cpp
SRCS+=./StudioModelRenderer.cpp
SRCS+=./text_message.cpp
SRCS+=./train.cpp
SRCS+=./tri.cpp
SRCS+=./util.cpp
SRCS+=./view.cpp
SRCS+=./input_xash3d.cpp
SRCS+=./scoreboard.cpp
SRCS+=./MOTD.cpp
INCLUDES = -I../common -I. -I../game_shared -I../pm_shared -I../engine -I../dlls
DEFINES = -Wno-write-strings -Dstricmp=strcasecmp -D_strnicmp=strncasecmp -Dstrnicmp=strncasecmp -DCLIENT_WEAPONS -DCLIENT_DLL
CFLAGS = -m32
OBJS = $(SRCS:.cpp=.o) $(SRCS_C:.c=.o)
LIBS=-lm
ifeq ($(shell uname -s),Linux)
LIBS=$(LIBS) -ldl
endif
%.o : %.c
$(CC) $(CFLAGS) $(INCLUDES) $(DEFINES) -fPIC -c $< -o $@
%.o : %.cpp
$(CXX) $(CFLAGS) $(INCLUDES) $(DEFINES) -fPIC -c $< -o $@
client.so : $(OBJS)
$(CXX) $(OBJS) -o client.so -shared -Wl,--no-undefined -fPIC $(LIBS)
clean:
$(RM) $(OBJS)

20
dlls/Makefile

@ -9,7 +9,8 @@ DLLNAME=hl
ARCH=i386 ARCH=i386
#make sure this is the correct compiler for your system #make sure this is the correct compiler for your system
CC=gcc CC?=gcc
CXX?=g++
DLL_SRCDIR=. DLL_SRCDIR=.
ENGINE_SRCDIR=../engine ENGINE_SRCDIR=../engine
@ -24,10 +25,10 @@ PM_SHARED_OBJDIR=$(PM_SHARED_SRCDIR)/obj
GAME_SHARED_OBJDIR=$(GAME_SHARED_SRCDIR)/obj GAME_SHARED_OBJDIR=$(GAME_SHARED_SRCDIR)/obj
BASE_CFLAGS= -Dstricmp=strcasecmp -D_strnicmp=strncasecmp -Dstrnicmp=strncasecmp \ BASE_CFLAGS= -Dstricmp=strcasecmp -D_strnicmp=strncasecmp -Dstrnicmp=strncasecmp \
-DCLIENT_WEAPONS -DCLIENT_WEAPONS -DNO_VOICEGAMEMGR
#safe optimization #safe optimization
CFLAGS=$(BASE_CFLAGS) -w -m486 -O1 CFLAGS=$(BASE_CFLAGS) -m32 -w -O1
#full optimization #full optimization
#CFLAGS=$(BASE_CFLAGS) -w -O1 -m486 -ffast-math -funroll-loops \ #CFLAGS=$(BASE_CFLAGS) -w -O1 -m486 -ffast-math -funroll-loops \
@ -46,6 +47,7 @@ SHLIBCFLAGS=-fPIC
SHLIBLDFLAGS=-shared SHLIBLDFLAGS=-shared
DO_CC=$(CC) $(CFLAGS) $(SHLIBCFLAGS) $(INCLUDEDIRS) -o $@ -c $< DO_CC=$(CC) $(CFLAGS) $(SHLIBCFLAGS) $(INCLUDEDIRS) -o $@ -c $<
DO_CXX=$(CXX) $(CFLAGS) $(SHLIBCFLAGS) $(INCLUDEDIRS) -o $@ -c $<
############################################################################# #############################################################################
# SETUP AND BUILD # SETUP AND BUILD
@ -53,13 +55,13 @@ DO_CC=$(CC) $(CFLAGS) $(SHLIBCFLAGS) $(INCLUDEDIRS) -o $@ -c $<
############################################################################# #############################################################################
$(DLL_OBJDIR)/%.o: $(DLL_SRCDIR)/%.cpp $(DLL_OBJDIR)/%.o: $(DLL_SRCDIR)/%.cpp
$(DO_CC) $(DO_CXX)
$(WPN_SHARED_OBJDIR)/%.o: $(WPN_SHARED_SRCDIR)/%.cpp $(WPN_SHARED_OBJDIR)/%.o: $(WPN_SHARED_SRCDIR)/%.cpp
$(DO_CC) $(DO_CXX)
$(GAME_SHARED_OBJDIR)/%.o: $(GAME_SHARED_SRCDIR)/%.cpp $(GAME_SHARED_OBJDIR)/%.o: $(GAME_SHARED_SRCDIR)/%.cpp
$(DO_CC) $(DO_CXX)
$(PM_SHARED_OBJDIR)/%.o: $(PM_SHARED_SRCDIR)/%.c $(PM_SHARED_OBJDIR)/%.o: $(PM_SHARED_SRCDIR)/%.c
$(DO_CC) $(DO_CC)
@ -161,14 +163,14 @@ OBJ = \
$(DLL_OBJDIR)/world.o \ $(DLL_OBJDIR)/world.o \
$(DLL_OBJDIR)/xen.o \ $(DLL_OBJDIR)/xen.o \
$(DLL_OBJDIR)/zombie.o \ $(DLL_OBJDIR)/zombie.o \
$(WPN_SHARED_OBJDIR)/hl_wpn_glock.o \ $(DLL_OBJDIR)/glock.o \
$(GAME_SHARED_OBJDIR)/voice_gamemgr.o \
$(PM_SHARED_OBJDIR)/pm_debug.o \ $(PM_SHARED_OBJDIR)/pm_debug.o \
$(PM_SHARED_OBJDIR)/pm_math.o \ $(PM_SHARED_OBJDIR)/pm_math.o \
$(PM_SHARED_OBJDIR)/pm_shared.o $(PM_SHARED_OBJDIR)/pm_shared.o
# $(GAME_SHARED_OBJDIR)/voice_gamemgr.o
$(DLLNAME)_$(ARCH).$(SHLIBEXT) : neat $(OBJ) $(DLLNAME)_$(ARCH).$(SHLIBEXT) : neat $(OBJ)
$(CC) $(CFLAGS) $(SHLIBLDFLAGS) $(LDFLAGS) -o $@ $(OBJ) $(CXX) $(CFLAGS) $(SHLIBLDFLAGS) $(LDFLAGS) -o $@ $(OBJ)
neat: neat:
-mkdir $(DLL_OBJDIR) -mkdir $(DLL_OBJDIR)

2
dlls/nodes.cpp

@ -40,7 +40,7 @@ CGraph WorldGraph;
LINK_ENTITY_TO_CLASS( info_node, CNodeEnt ); LINK_ENTITY_TO_CLASS( info_node, CNodeEnt );
LINK_ENTITY_TO_CLASS( info_node_air, CNodeEnt ); LINK_ENTITY_TO_CLASS( info_node_air, CNodeEnt );
#if defined _LINUX && !defined _WIN32 #if !defined _WIN32
#include <unistd.h> #include <unistd.h>
#include <sys/stat.h> #include <sys/stat.h>
#define CreateDirectory(p, n) mkdir(p, 0777) #define CreateDirectory(p, n) mkdir(p, 0777)

Loading…
Cancel
Save