amxmodx/hlsdk/ricochet/dlls/Makefile
2006-08-27 02:22:59 +00:00

138 lines
3.6 KiB
Makefile

#
# Half-Life Ricochet SDK 2.3 ricochet_i386.so Makefile for x86 Linux
#
# October 2002 by Leon Hartwig (hartwig@valvesoftware.com)
#
DLLNAME=ricochet
ARCH=i386
#make sure this is the correct compiler for your system
CC=gcc
DLL_SRCDIR=.
ENGINE_SRCDIR=../../engine
COMMON_SRCDIR=../../common
PM_SHARED_SRCDIR=../pm_shared
GAME_SHARED_SRCDIR=../../game_shared
WPN_SRC_DIR=$(DLL_SRCDIR)/wpn_shared
DLL_OBJDIR=$(DLL_SRCDIR)/obj
PM_SHARED_OBJDIR=$(DLL_OBJDIR)/pm_shared
GAME_SHARED_OBJDIR=$(DLL_OBJDIR)/game_shared
WPN_OBJ_DIR=$(DLL_OBJDIR)/wpn_shared
BASE_CFLAGS=-Dstricmp=strcasecmp -D_strnicmp=strncasecmp -Dstrnicmp=strncasecmp -D_vsnprintf=vsnprintf
#safe optimization
CFLAGS=$(BASE_CFLAGS) -Wall -Wno-non-virtual-dtor -Wno-invalid-offsetof -Werror -m486 -O1
C_FLAGS=$(BASE_CFLAGS) -Wall -Werror -m486 -O1
#full optimization
#CFLAGS=$(BASE_CFLAGS) -Wall -Wno-non-virtual-dtor -Wno-invalid-offsetof -Werror -O1 -m486 -ffast-math -funroll-loops \
-fomit-frame-pointer -fexpensive-optimizations \
-malign-loops=2 -malign-jumps=2 -malign-functions=2
#use these when debugging
#CFLAGS=$(BASE_CFLAGS) -g
INCLUDEDIRS=-I. -I$(ENGINE_SRCDIR) -I$(COMMON_SRCDIR) -I$(PM_SHARED_SRCDIR) -I$(GAME_SHARED_SRCDIR)
LDFLAGS=
SHLIBEXT=so
SHLIBCFLAGS=-fPIC
SHLIBLDFLAGS=-shared
DO_CC=$(CC) $(CFLAGS) $(SHLIBCFLAGS) $(INCLUDEDIRS) -o $@ -c $<
DO_C=$(CC) $(C_FLAGS) $(SHLIBCFLAGS) $(INCLUDEDIRS) -o $@ -c $<
#############################################################################
# SETUP AND BUILD
# GAME
#############################################################################
$(DLL_OBJDIR)/%.o: $(DLL_SRCDIR)/%.cpp
$(DO_CC)
$(GAME_SHARED_OBJDIR)/%.o: $(GAME_SHARED_SRCDIR)/%.cpp
$(DO_CC)
$(PM_SHARED_OBJDIR)/%.o: $(PM_SHARED_SRCDIR)/%.c
$(DO_C)
$(WPN_OBJ_DIR)/%.o : $(WPN_SRC_DIR)/%.cpp
$(DO_CC)
OBJ = \
$(DLL_OBJDIR)/airtank.o \
$(DLL_OBJDIR)/animating.o \
$(DLL_OBJDIR)/animation.o \
$(DLL_OBJDIR)/bmodels.o \
$(DLL_OBJDIR)/buttons.o \
$(DLL_OBJDIR)/cbase.o \
$(DLL_OBJDIR)/client.o \
$(DLL_OBJDIR)/combat.o \
$(DLL_OBJDIR)/disc_arena.o \
$(DLL_OBJDIR)/disc_powerups.o \
$(DLL_OBJDIR)/doors.o \
$(DLL_OBJDIR)/effects.o \
$(DLL_OBJDIR)/explode.o \
$(DLL_OBJDIR)/func_break.o \
$(DLL_OBJDIR)/func_tank.o \
$(DLL_OBJDIR)/game.o \
$(DLL_OBJDIR)/gamerules.o \
$(DLL_OBJDIR)/ggrenade.o \
$(DLL_OBJDIR)/globals.o \
$(DLL_OBJDIR)/h_ai.o \
$(DLL_OBJDIR)/h_battery.o \
$(DLL_OBJDIR)/h_cycler.o \
$(DLL_OBJDIR)/h_export.o \
$(DLL_OBJDIR)/healthkit.o \
$(DLL_OBJDIR)/items.o \
$(DLL_OBJDIR)/lights.o \
$(DLL_OBJDIR)/maprules.o \
$(DLL_OBJDIR)/mortar.o \
$(DLL_OBJDIR)/mpstubb.o \
$(DLL_OBJDIR)/multiplay_gamerules.o \
$(DLL_OBJDIR)/observer.o \
$(DLL_OBJDIR)/pathcorner.o \
$(DLL_OBJDIR)/plane.o \
$(DLL_OBJDIR)/plats.o \
$(DLL_OBJDIR)/player.o \
$(DLL_OBJDIR)/singleplay_gamerules.o \
$(DLL_OBJDIR)/skill.o \
$(DLL_OBJDIR)/sound.o \
$(DLL_OBJDIR)/soundent.o \
$(DLL_OBJDIR)/spectator.o \
$(DLL_OBJDIR)/subs.o \
$(DLL_OBJDIR)/teamplay_gamerules.o \
$(DLL_OBJDIR)/triggers.o \
$(DLL_OBJDIR)/util.o \
$(DLL_OBJDIR)/weapons.o \
$(DLL_OBJDIR)/world.o \
$(DLL_OBJDIR)/xen.o \
$(WPN_OBJ_DIR)/disc_weapon_disc.o \
$(PM_SHARED_OBJDIR)/pm_shared.o \
$(PM_SHARED_OBJDIR)/pm_math.o \
$(PM_SHARED_OBJDIR)/pm_debug.o \
$(GAME_SHARED_OBJDIR)/voice_gamemgr.o
$(DLLNAME)_$(ARCH).$(SHLIBEXT) : neat $(OBJ)
$(CC) $(CFLAGS) $(SHLIBLDFLAGS) $(LDFLAGS) -o $@ $(OBJ)
neat:
-mkdir -p $(DLL_OBJDIR)
-mkdir -p $(GAME_SHARED_OBJDIR)
-mkdir -p $(PM_SHARED_OBJDIR)
-mkdir -p $(WPN_OBJ_DIR)
clean:
-rm -f $(OBJ)
-rm -f $(DLLNAME)_$(ARCH).$(SHLIBEXT)
spotless: clean
-rm -rf $(WPN_OBJ_DIR)
-rm -rf $(GAME_SHARED_OBJDIR)
-rm -rf $(PM_SHARED_OBJDIR)
-rm -rf $(DLL_OBJDIR)