2005-05-17 22:05:45 +00:00
2013-05-04 10:40:05 +00:00
#windows is special as always, but we don't support itanium, and microsoft don't support anything else (not even arm with the nt win32 api)
i f e q ( $( FTE_TARGET ) , w i n 3 2 )
2017-04-18 11:12:17 +00:00
PLUG_NATIVE_EXT = _x86.dll
2018-12-10 12:06:57 +00:00
PLUG_LDFLAGS = -static-libgcc
2017-04-16 09:27:43 +00:00
PLUG_LDFLAGS_ZLIB = -L../engine/libs/mingw-libs -lzlib
2017-04-18 11:12:17 +00:00
BITS = 32
PLUG_LDFLAGS_DL =
2019-10-18 07:04:38 +00:00
CMAKERULES = $( OUT_DIR) /toolchain_$( FTE_TARGET) .cmake
2013-05-04 10:40:05 +00:00
e n d i f
i f e q ( $( FTE_TARGET ) , w i n 6 4 )
2017-04-18 11:12:17 +00:00
PLUG_NATIVE_EXT = _x64.dll
2018-12-10 12:06:57 +00:00
PLUG_LDFLAGS = -Wl,--support-old-code -static-libgcc
2017-04-16 09:27:43 +00:00
PLUG_LDFLAGS_ZLIB = -L../engine/libs/mingw64-libs -lz
2017-04-18 11:12:17 +00:00
BITS = 64
PLUG_LDFLAGS_DL =
2019-10-18 07:04:38 +00:00
CMAKERULES = $( OUT_DIR) /toolchain_$( FTE_TARGET) .cmake
2013-05-04 10:40:05 +00:00
e n d i f
2019-05-10 02:06:07 +00:00
PLUG_PREFIX = $( OUT_DIR) /fteplug_
2018-12-10 12:06:57 +00:00
PLUG_LDFLAGS_DL ?= -ldl -static-libgcc
2017-04-16 09:27:43 +00:00
PLUG_LDFLAGS ?= -L/usr/local/lib -Wl,-R/usr/local/lib -lm
PLUG_LDFLAGS_ZLIB ?= -lz
2013-05-04 10:40:05 +00:00
i f n e q ( $( PLUG_NATIVE_EXT ) , )
2017-04-18 11:12:17 +00:00
#if we're on windows, we'll put our windows-specific hacks here.
PLUG_DEFFILE = plugin.def
PLUG_CFLAGS =
PLUG_CXXFLAGS =
2013-05-04 10:40:05 +00:00
e n d i f
2013-11-21 23:02:28 +00:00
#cygwin uses dll naming.
i f e q ( $( FTE_TARGET ) , c y g w i n )
2017-04-18 11:12:17 +00:00
ifeq ( $( BITS) ,64)
PLUG_DEFFILE = plugin.def
PLUG_NATIVE_EXT = _amd64.dll
endif
ifneq ( $( BITS) ,64)
PLUG_DEFFILE = plugin.def
PLUG_NATIVE_EXT = _x86.dll
endif
2013-11-21 23:02:28 +00:00
e n d i f
2013-05-04 10:40:05 +00:00
#if they're not on windows, we'll try asking the compiler directly
#the check to see if its already set is to avoid asking msvc, which would probably break things.
i f e q ( $( PLUG_NATIVE_EXT ) , )
2017-04-16 09:27:43 +00:00
LIBRESOLV = -lresolv
2017-04-18 11:12:17 +00:00
ifneq ( $( shell echo| $( CC) -E -dM -| grep __amd64__) ,)
#either x32 or x64 ABIs
ifneq ( $( shell echo| $( CC) -E -dM -| grep __ILP32__| grep 1) ,)
PLUG_NATIVE_EXT = _x32.so
else
PLUG_NATIVE_EXT = _amd64.so
endif
2017-04-16 09:27:43 +00:00
endif
2017-04-18 11:12:17 +00:00
ifneq ( $( shell echo| $( CC) -E -dM -| grep __i386__) ,)
PLUG_NATIVE_EXT = _x86.so
endif
ifneq ( $( shell echo| $( CC) -E -dM -| grep __arm__) ,)
#gnueabi[hf]
ifneq ( $( shell echo| $( CC) -E -dM -| grep __SOFTFP__) ,)
PLUG_NATIVE_EXT = _arm.so
else
PLUG_NATIVE_EXT = _armhf.so
endif
endif
ifneq ( $( shell echo| $( CC) -E -dM -| grep __ppc__) ,)
PLUG_NATIVE_EXT = _ppc.so
2017-04-16 09:27:43 +00:00
endif
2013-05-04 10:40:05 +00:00
e n d i f
2019-05-10 02:06:07 +00:00
i f e q ( $( FTE_TARGET ) , d r o i d )
#plugins get written to the tmp build dir, to avoid conflicts
2019-06-21 03:59:46 +00:00
PLUG_PREFIX = $( OUT_DIR) /m_droid-$( DROID_ARCH) /libplug_
2019-05-10 02:06:07 +00:00
#don't bother with cpu arch postfixes. they'll be in separate directories anyway.
PLUG_NATIVE_EXT = .so
#libresolv has no public api on android...
LIBRESOLV =
#so we know our target.
PLUG_CFLAGS = -DANDROID
PLUG_CXXFLAGS = -DANDROID
e n d i f
2013-05-04 10:40:05 +00:00
#fallback
2015-06-03 16:42:37 +00:00
PLUG_NATIVE_EXT ?= _unk.so
2013-05-04 10:40:05 +00:00
PLUG_DEFFILE ?=
2018-12-10 12:06:57 +00:00
PLUG_CFLAGS ?= -fPIC -Wl,--no-undefined -Bsymbolic -fvisibility= hidden -static-libgcc
PLUG_CXXFLAGS ?= -fPIC -Wl,--no-undefined -Bsymbolic -fvisibility= hidden -static-libgcc
2018-08-04 19:00:19 +00:00
PLUG_CMAKE ?= -DCMAKE_POSITION_INDEPENDENT_CODE= ON -DCMAKE_C_COMPILER= $( CC) -DCMAKE_CXX_COMPILER= $( CXX)
2017-04-16 09:27:43 +00:00
PLUG_LDFLAGS_ZLIB ?=
ARCH := $( shell $( CC) -dumpmachine)
PLUG_LDFLAGS := -L../engine/libs-$( ARCH) $( PLUG_LDFLAGS)
PLUG_CFLAGS := -I../engine/libs-$( ARCH) $( PLUG_CFLAGS)
PLUG_CXXFLAGS := -I../engine/libs-$( ARCH) $( PLUG_CXXFLAGS)
2013-05-04 10:40:05 +00:00
2019-09-04 07:59:40 +00:00
#legacy build rule, now equivelent to all
native : all
2005-05-17 22:05:45 +00:00
2016-07-12 00:40:13 +00:00
clean : ezscript -clean qi -clean hud -clean irc -clean
2007-10-05 09:59:27 +00:00
2019-09-04 07:59:40 +00:00
.PHONY : all native distclean clean
2005-05-17 22:05:45 +00:00
help :
@-echo make a subdirectory
2013-05-04 10:40:05 +00:00
#small script to download+install avformat for windows cross compiles.
#linux users are expected to have the library installed locally already. If your version is too old or missing, run the following command to install it (to /usr/local), then delete the gz and directory.
#wget http://ffmpeg.org/releases/ffmpeg-1.2.tar.gz && cd tar xvfz ffmpeg-1.2.tar.gz && cd ffmpeg-1.2/ && ./configure --disable-yasm --enable-shared && make && sudo make install
#we use ffmpeg's version for some reason, as opposed to libav. not sure what the differences are meant to be, but libav seemed to have non-depricated functions defined, docs that say to use them, and these functions missing.
2018-07-05 16:39:01 +00:00
AV_VER = ffmpeg-4.0
playdemo accepts https urls now. will start playing before the file has finished downloading, to avoid unnecessary delays.
reworked network addresses to separate address family and connection type. this should make banning people more reliable, as well as simplifying a whole load of logic (no need to check for ipv4 AND ipv6).
tcpconnect will keep trying to connect even if the connection wasn't instant, instead of giving up instantly.
rewrote tcp connections quite a bit. sv_port_tcp now handles qtv+qizmo+http+ws+rtcbroker+tls equivalents.
qtv_streamport is now a legacy cvar and now acts equivalently to sv_port_tcp (but still separate).
rewrote screenshot and video capture code to use strides. this solves image-is-upside down issues with vulkan.
ignore alt key in browser port. oh no! no more red text! oh no! no more alt-being-wrongly-down-and-being-unable-to-type-anything-without-forcing-alt-released!
reworked audio decoder interface. now has clearly defined success/unavailable/end-of-file results. this should solve a whole load of issues with audio streaming.
fixed various openal audio streaming issues too. openal also got some workarounds for emscripten's poor emulation.
fixed ogg decoder to retain sync properly if seeked.
updated menu_media a bit. now reads vorbis comments/id3v1 tags to get proper track names. also saves the playlist so you don't have to manually repopulate the list so it might actually be usable now (after how many years?)
r_stains now defaults to 0, and is no longer enabled by presets. use decals if you want that sort of thing.
added fs_noreexec cvar, so configs will not be reexeced on gamedir change. this also means defaults won't be reapplied, etc.
added 'nvvk' renderer on windows, using nvidia's vulkan-inside-opengl gl extension. mostly just to see how much slower it is.
fixed up the ftp server quite a lot. more complete, more compliant, and should do ipv6 properly to-boot. file transfers also threaded.
fixed potential crash inside runclientphys.
experimental sv_antilag=3 setting. totally untested. the aim is to avoid missing due to lagged knockbacks. may be expensive for the server.
browser port's websockets support fixed. experimental support for webrtc ('works for me', requires a broker server).
updated avplug(renamed to ffmpeg so people know what it is) to use ffmpeg 3.2.4 properly, with its new encoder api. should be much more robust... also added experimental audio decoder for game music etc (currently doesn't resample, so playback rates are screwed, disabled by cvar).
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5097 fc73d0e0-1445-4013-8a0c-d673dee63da5
2017-05-10 02:08:58 +00:00
i f e q ( 0 , 1 )
AV_ARCHIVEEXT = .z7
AV_EXTRACT = 7z e -y
e l s e
AV_ARCHIVEEXT = .zip
2017-08-12 19:32:09 +00:00
AV_EXTRACT = unzip -ju
playdemo accepts https urls now. will start playing before the file has finished downloading, to avoid unnecessary delays.
reworked network addresses to separate address family and connection type. this should make banning people more reliable, as well as simplifying a whole load of logic (no need to check for ipv4 AND ipv6).
tcpconnect will keep trying to connect even if the connection wasn't instant, instead of giving up instantly.
rewrote tcp connections quite a bit. sv_port_tcp now handles qtv+qizmo+http+ws+rtcbroker+tls equivalents.
qtv_streamport is now a legacy cvar and now acts equivalently to sv_port_tcp (but still separate).
rewrote screenshot and video capture code to use strides. this solves image-is-upside down issues with vulkan.
ignore alt key in browser port. oh no! no more red text! oh no! no more alt-being-wrongly-down-and-being-unable-to-type-anything-without-forcing-alt-released!
reworked audio decoder interface. now has clearly defined success/unavailable/end-of-file results. this should solve a whole load of issues with audio streaming.
fixed various openal audio streaming issues too. openal also got some workarounds for emscripten's poor emulation.
fixed ogg decoder to retain sync properly if seeked.
updated menu_media a bit. now reads vorbis comments/id3v1 tags to get proper track names. also saves the playlist so you don't have to manually repopulate the list so it might actually be usable now (after how many years?)
r_stains now defaults to 0, and is no longer enabled by presets. use decals if you want that sort of thing.
added fs_noreexec cvar, so configs will not be reexeced on gamedir change. this also means defaults won't be reapplied, etc.
added 'nvvk' renderer on windows, using nvidia's vulkan-inside-opengl gl extension. mostly just to see how much slower it is.
fixed up the ftp server quite a lot. more complete, more compliant, and should do ipv6 properly to-boot. file transfers also threaded.
fixed potential crash inside runclientphys.
experimental sv_antilag=3 setting. totally untested. the aim is to avoid missing due to lagged knockbacks. may be expensive for the server.
browser port's websockets support fixed. experimental support for webrtc ('works for me', requires a broker server).
updated avplug(renamed to ffmpeg so people know what it is) to use ffmpeg 3.2.4 properly, with its new encoder api. should be much more robust... also added experimental audio decoder for game music etc (currently doesn't resample, so playback rates are screwed, disabled by cvar).
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5097 fc73d0e0-1445-4013-8a0c-d673dee63da5
2017-05-10 02:08:58 +00:00
e n d i f
2018-04-06 15:32:18 +00:00
AV_W32_DEV = $( AV_VER) -win32-dev$( AV_ARCHIVEEXT)
AV_W64_DEV = $( AV_VER) -win64-dev$( AV_ARCHIVEEXT)
AV_W32_BIN = $( AV_VER) -win32-shared$( AV_ARCHIVEEXT)
AV_W64_BIN = $( AV_VER) -win64-shared$( AV_ARCHIVEEXT)
AV_URL32_DEV = https://ffmpeg.zeranoe.com/builds/win32/dev/$( AV_W32_DEV)
AV_URL64_DEV = https://ffmpeg.zeranoe.com/builds/win64/dev/$( AV_W64_DEV)
AV_URL32_BIN = https://ffmpeg.zeranoe.com/builds/win32/shared/$( AV_W32_BIN)
AV_URL64_BIN = https://ffmpeg.zeranoe.com/builds/win64/shared/$( AV_W64_BIN)
AV_PRE32_DEV = $( AV_VER) -win32-dev/
AV_PRE64_DEV = $( AV_VER) -win64-dev/
AV_PRE32_BIN = $( AV_VER) -win32-shared/
AV_PRE64_BIN = $( AV_VER) -win64-shared/
2017-05-10 02:57:34 +00:00
i f e q ( $( findstring win ,$ ( FTE_TARGET ) ) , w i n )
2017-08-12 19:32:09 +00:00
AV_BASE = $( abspath $( OUT_DIR) /../fte_libav_$( AV_VER) ) /
2017-05-10 02:57:34 +00:00
e n d i f
i f n e q ( $( AV_BASE ) , )
AV_DEP = $( AV_BASE) libavformat/avformat.h
AV_CFLAGS = -I$( AV_BASE)
AV_LDFLAGS = -L$( AV_BASE) lib$( BITS) -lavcodec -lavformat -lavutil -lswscale
e l s e
AV_LDFLAGS = -lavcodec -lavformat -lavutil -lswscale
e n d i f
2013-05-04 10:40:05 +00:00
2016-07-12 00:40:13 +00:00
2019-09-04 07:59:40 +00:00
AVPLUG_OBJS = avplug/avaudio.c avplug/avencode.c avplug/avdecode.c plugin.c
2016-07-12 00:40:13 +00:00
i f e q ( $( FTE_TARGET ) , w i n 3 2 )
2018-04-06 15:32:18 +00:00
FFMPEG_ZIP = $( OUT_DIR) /$( AV_VER) -x86.zip
2017-05-10 02:57:34 +00:00
#NATIVE_PLUGINS+=ffmpeg
2016-07-12 00:40:13 +00:00
e n d i f
i f e q ( $( FTE_TARGET ) , w i n 6 4 )
2018-04-06 15:32:18 +00:00
FFMPEG_ZIP = $( OUT_DIR) /$( AV_VER) -x64.zip
2017-05-10 02:57:34 +00:00
#NATIVE_PLUGINS+=ffmpeg
2016-07-12 00:40:13 +00:00
e n d i f
2018-04-06 15:32:18 +00:00
$(AV_BASE)$(AV_VER)-win32.zip :
mkdir -p $( AV_BASE)
cd $( AV_BASE) && wget -N $( AV_URL32_BIN)
mkdir -p $( AV_BASE) bin32 && cd $( AV_BASE) bin32 && $( AV_EXTRACT) ../$( AV_W32_BIN) $( AV_PRE32_BIN) bin/avcodec-*.dll $( AV_PRE32_BIN) bin/avutil-*.dll $( AV_PRE32_BIN) bin/swresample-*.dll $( AV_PRE32_BIN) bin/avformat-*.dll $( AV_PRE32_BIN) bin/swscale-*.dll && cd -
zip -j9 $@ $( AV_BASE) bin32/*.dll
$(AV_BASE)$(AV_VER)-win64.zip :
mkdir -p $( AV_BASE)
cd $( AV_BASE) && wget -N $( AV_URL64_BIN)
mkdir -p $( AV_BASE) bin64 && cd $( AV_BASE) bin64 && $( AV_EXTRACT) ../$( AV_W64_BIN) $( AV_PRE64_BIN) bin/avcodec-*.dll $( AV_PRE64_BIN) bin/avutil-*.dll $( AV_PRE64_BIN) bin/swresample-*.dll $( AV_PRE64_BIN) bin/avformat-*.dll $( AV_PRE64_BIN) bin/swscale-*.dll && cd -
zip -j9 $@ $( AV_BASE) bin64/*.dll
i f n e q ( $( FFMPEG_ZIP ) , )
$(FFMPEG_ZIP) : $( AV_BASE ) $( AV_VER ) -$( FTE_TARGET ) .zip
cp $( AV_BASE) $( AV_VER) -$( FTE_TARGET) .zip $@
e n d i f
2016-07-12 00:40:13 +00:00
$(AV_BASE)libavformat/avformat.h :
mkdir -p $( AV_BASE)
2018-04-06 15:32:18 +00:00
cd $( AV_BASE) && wget -N $( AV_URL32_DEV)
mkdir -p $( AV_BASE) libavformat && cd $( AV_BASE) libavformat && $( AV_EXTRACT) ../$( AV_W32_DEV) $( AV_PRE32_DEV) include/libavformat/* && cd -
mkdir -p $( AV_BASE) libavcodec && cd $( AV_BASE) libavcodec && $( AV_EXTRACT) ../$( AV_W32_DEV) $( AV_PRE32_DEV) include/libavcodec/* && cd -
mkdir -p $( AV_BASE) libavutil && cd $( AV_BASE) libavutil && $( AV_EXTRACT) ../$( AV_W32_DEV) $( AV_PRE32_DEV) include/libavutil/* && cd -
mkdir -p $( AV_BASE) libswscale && cd $( AV_BASE) libswscale && $( AV_EXTRACT) ../$( AV_W32_DEV) $( AV_PRE32_DEV) include/libswscale/* && cd -
mkdir -p $( AV_BASE) lib32 && cd $( AV_BASE) lib32 && $( AV_EXTRACT) ../$( AV_W32_DEV) $( AV_PRE32_DEV) lib/avformat.lib $( AV_PRE32_DEV) lib/avcodec.lib $( AV_PRE32_DEV) lib/avutil.lib $( AV_PRE32_DEV) lib/swscale.lib && cd -
2017-08-12 19:32:09 +00:00
#rm $(AV_BASE)$(AV_W32)
2018-04-06 15:32:18 +00:00
cd $( AV_BASE) && wget -N $( AV_URL64_DEV)
mkdir -p $( AV_BASE) lib64 && cd $( AV_BASE) lib64 && $( AV_EXTRACT) ../$( AV_W64_DEV) $( AV_PRE64_DEV) lib/avformat.lib $( AV_PRE64_DEV) lib/avcodec.lib $( AV_PRE64_DEV) lib/avutil.lib $( AV_PRE64_DEV) lib/swscale.lib && cd -
2017-08-12 19:32:09 +00:00
#rm $(AV_BASE)$(AV_W64)
2016-07-12 00:40:13 +00:00
distclean :
rm $( AV_BASE) libavformat/avformat.h
2018-04-06 15:32:18 +00:00
rm $( AV_BASE) $( AV_VER) -win32.zip
rm $( AV_BASE) $( AV_VER) -win64.zip
2017-08-12 19:32:09 +00:00
2019-05-10 02:06:07 +00:00
$(PLUG_PREFIX)ffmpeg$(PLUG_NATIVE_EXT) : $( AV_DEP ) $( FFMPEG_ZIP )
2014-04-24 01:53:01 +00:00
2019-05-10 02:06:07 +00:00
$(PLUG_PREFIX)ffmpeg$(PLUG_NATIVE_EXT) : $( AVPLUG_OBJS )
2017-05-10 02:57:34 +00:00
$( CC) $( BASE_CFLAGS) $( CFLAGS) -DFTEPLUGIN -s -o $@ -shared $( PLUG_CFLAGS) $( AV_CFLAGS) $( AVPLUG_OBJS) $( PLUG_DEFFILE) $( PLUG_LDFLAGS) $( AV_LDFLAGS)
2016-07-12 00:40:13 +00:00
#small script for ode
#FIXME: ode fails to compile under cygwin
2017-05-10 02:57:34 +00:00
#FIXME: race condition if you try compiling debug+release at the same time, as this makefile is invoked twice by the engine's one
2016-07-12 00:40:13 +00:00
ODE_ARCH = $( FTE_TARGET)
i f e q ( $( ODE_ARCH ) , )
ODE_ARCH = unknown
e n d i f
ODE_VER = 0.14
ODE_URL = https://bitbucket.org/odedevs/ode/downloads/ode-$( ODE_VER) .tar.gz
ODE_BASE = $( OUT_DIR) /../ode-$( ODE_VER) _$( ODE_ARCH) /
ODE_LIB = $( ODE_BASE) ode-$( ODE_VER) /ode/src/.libs/libode.a
$(OUT_DIR)/../ode-$(ODE_VER).tar.gz :
mkdir -p $( ODE_BASE)
2017-08-12 19:32:09 +00:00
cd $( OUT_DIR) /.. && wget -N $( ODE_URL)
2016-07-12 00:40:13 +00:00
$(ODE_LIB) : $( OUT_DIR ) /../ode -$( ODE_VER ) .tar .gz
mkdir -p $( ODE_BASE) && cd $( ODE_BASE) && tar xvfz $<
cd $( ODE_BASE) ode-$( ODE_VER) / && ./bootstrap && ./configure --enable-double-precision --disable-demos --without-x --with-pic CC = " $( CC) $( PLUG_CXXFLAGS) " CXX = " $( CC) $( PLUG_CXXFLAGS) " --host= ` $( CC) -dumpmachine` && make
2019-09-04 07:59:40 +00:00
ODE_FILES = ../engine/common/com_phys_ode.c ../engine/common/mathlib.c plugin.c $( ODE_LIB)
2019-05-10 02:06:07 +00:00
$(PLUG_PREFIX)ode$(PLUG_NATIVE_EXT) : $( ODE_FILES )
2016-07-15 12:26:24 +00:00
$( CC) -flto -s $( BASE_CFLAGS) $( CFLAGS) -Os -DFTEPLUGIN -DODE_STATIC -o $@ -shared $( PLUG_CFLAGS) -I$( ODE_BASE) ode-$( ODE_VER) /include $( ODE_FILES) $( PLUG_DEFFILE) $( PLUG_LDFLAGS) -static-libgcc ` $( CC) -print-file-name= libstdc++.a` -lpthread
2016-07-12 00:40:13 +00:00
#NATIVE_PLUGINS+=ode
2019-10-18 07:04:38 +00:00
i f n e q ( $( CMAKERULES ) , )
BULLET_CFLAGS += -static-libstdc++
PLUG_CMAKE += -DCMAKE_TOOLCHAIN_FILE= " $( CMAKERULES) "
$(CMAKERULES) :
echo "set(CMAKE_SYSTEM_NAME Windows)" > $@
echo " set(TOOLCHAIN_PREFIX ` $( CC) -dumpmachine`) " >> $@
# cross compilers to use for C, C++ and Fortran
echo " set(CMAKE_C_COMPILER $( CC) ) " >> $@
echo " set(CMAKE_CXX_COMPILER $( CXX) ) " >> $@
echo " set(CMAKE_RC_COMPILER $$ {TOOLCHAIN_PREFIX}-windres) " >> $@
# target environment on the build host system
echo " set(CMAKE_FIND_ROOT_PATH /usr/ $$ {TOOLCHAIN_PREFIX}) " >> $@
# modify default behavior of FIND_XXX() commands
echo "set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)" >> $@
echo "set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)" >> $@
echo "set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)" >> $@
e n d i f
2016-07-12 00:40:13 +00:00
2018-08-04 19:00:19 +00:00
BULLET_VER = 2.87
2016-07-12 00:40:13 +00:00
BULLET_URL = https://github.com/bulletphysics/bullet3/archive/$( BULLET_VER) .tar.gz
2018-08-04 19:00:19 +00:00
BULLET_BASE = $( OUT_DIR) /../bullet3-$( BULLET_VER) _$( FTE_TARGET) /
BULLET_LIBS = \
2019-10-18 07:04:38 +00:00
$( BULLET_BASE) bullet3-$( BULLET_VER) /lib/libBulletDynamics.a \
$( BULLET_BASE) bullet3-$( BULLET_VER) /lib/libBulletCollision.a \
$( BULLET_BASE) bullet3-$( BULLET_VER) /lib/libLinearMath.a
BULLET_CFLAGS += -I$( BULLET_BASE) bullet3-$( BULLET_VER) /src
2016-07-12 00:40:13 +00:00
$(OUT_DIR)/../bullet3-$(BULLET_VER).tar.gz :
mkdir -p $( BULLET_BASE)
2017-08-12 19:32:09 +00:00
wget -N $( BULLET_URL) -O $@
2018-08-04 19:00:19 +00:00
2019-10-18 07:04:38 +00:00
BULLET_LIB = $( BULLET_BASE) bullet3-$( BULLET_VER) /lib/libLinearMath.a
$(BULLET_BASE)bullet3-$(BULLET_VER)/lib/libBulletDynamics.a $(BULLET_BASE)bullet3-$(BULLET_VER)/lib/libBulletCollision.a : $( BULLET_LIB )
$(BULLET_LIB) : $( OUT_DIR ) /../bullet 3-$( BULLET_VER ) .tar .gz $( CMAKERULES )
2016-07-12 00:40:13 +00:00
mkdir -p $( BULLET_BASE) && cd $( BULLET_BASE) && tar xvfz $<
2019-10-18 07:04:38 +00:00
rm $( BULLET_BASE) bullet3-$( BULLET_VER) /build3/cmake/FindPythonLibs.cmake #cmake is a pile of shite and fails at cross compiling. oh well, we didn't want any python stuff anyway.
cd $( BULLET_BASE) bullet3-$( BULLET_VER) / && cmake $( PLUG_CMAKE) -DBUILD_DEMOS:BOOL= OFF -DBUILD_EXTRAS:BOOL= OFF -DLIBRARY_OUTPUT_PATH= $( BULLET_BASE) bullet3-$( BULLET_VER) /lib . && $( MAKE) LinearMath BulletDynamics BulletCollision
2018-08-04 19:00:19 +00:00
#./configure --enable-double-precision --disable-demos --without-x CXX="$(CC)" CFLAGS="$(PLUG_CFLAGS)" CXXFLAGS="$(PLUG_CXXFLAGS)" --host=`$(CC) -dumpmachine` && make
2016-07-12 00:40:13 +00:00
2019-09-04 07:59:40 +00:00
$(PLUG_PREFIX)bullet$(PLUG_NATIVE_EXT) : bullet /bulletplug .cpp plugin .c $( BULLET_LIBS )
2019-10-01 22:32:06 +00:00
$( CXX) $( BASE_CXXFLAGS) $( CFLAGS) -DFTEPLUGIN -o $@ -shared $( PLUG_CFLAGS) $^ $( PLUG_DEFFILE) $( PLUG_LDFLAGS) $( BULLET_CFLAGS)
2016-07-12 00:40:13 +00:00
#NATIVE_PLUGINS+=bullet
- i n c l u d e M a k e f i l e . p r i v a t e
2013-05-04 10:40:05 +00:00
2019-09-04 07:59:40 +00:00
$(PLUG_PREFIX)mpq$(PLUG_NATIVE_EXT) : mpq /fs_mpq .c mpq /blast .c plugin .c
2017-04-16 09:27:43 +00:00
$( CC) $( BASE_CFLAGS) $( CFLAGS) -DFTEPLUGIN -o $@ -shared $( PLUG_CFLAGS) -Impq $^ $( PLUG_DEFFILE) $( PLUG_LDFLAGS_ZLIB) $( PLUG_LDFLAGS)
2016-07-12 00:40:13 +00:00
NATIVE_PLUGINS += mpq
2013-05-04 10:40:05 +00:00
2019-09-04 07:59:40 +00:00
$(PLUG_PREFIX)xmpp$(PLUG_NATIVE_EXT) : jabber /jabberclient .c jabber /jingle .c jabber /sift .c jabber /xml .c plugin .c ../engine /common /sha 1.c emailnot /md 5.c
2016-07-12 00:40:13 +00:00
$( CC) $( BASE_CFLAGS) $( CFLAGS) -DFTEPLUGIN -o $@ -shared $( PLUG_CFLAGS) -Ijabber $^ $( PLUG_DEFFILE) $( PLUG_LDFLAGS) $( LIBRESOLV)
NATIVE_PLUGINS += xmpp
2019-09-04 07:59:40 +00:00
$(PLUG_PREFIX)qi$(PLUG_NATIVE_EXT) : qi /qi .c jabber /xml .c plugin .c
2016-07-12 00:40:13 +00:00
$( CC) $( BASE_CFLAGS) $( CFLAGS) -DFTEPLUGIN -o $@ -shared $( PLUG_CFLAGS) -Ijabber $^ $( PLUG_DEFFILE) $( PLUG_LDFLAGS)
NATIVE_PLUGINS += qi
2017-09-21 05:18:22 +00:00
#Regarding CEF Versions: Cef 2526 is reportedly the most recent _WORKING_ version of libcef. Later versions have screwed webgl etc, and are just generally unstable.
#However, that's now impossible to get hold of since the old cefbuilds server went down. New builds are hosted by spotify and they're all randomly broken, so we might as well just use whatever seems fairly recent.
#WARNING: Changing CEF_VER requires updating downloadables.php etc
2016-07-17 18:41:01 +00:00
i f e q ( $( FTE_TARGET ) , w i n 3 2 )
2017-09-21 05:18:22 +00:00
CEF_ARCH = windows32
2016-07-17 18:41:01 +00:00
e n d i f
i f e q ( $( FTE_TARGET ) , w i n 6 4 )
2017-09-21 05:18:22 +00:00
CEF_ARCH = windows64
2016-07-17 18:41:01 +00:00
e n d i f
2017-09-21 05:18:22 +00:00
i f e q ( $( FTE_TARGET ) , l i n u x 3 2 )
#CEF_ARCH=linux32
e n d i f
i f e q ( $( FTE_TARGET ) , l i n u x 6 4 )
#CEF_ARCH=linux64
e n d i f
#ifeq ($(FTE_TARGET),macosx64)
#CEF_ARCH=macosx64
#endif
CEF_VER = 3.3163.1666.g052c2d2
CEF_NAME = cef_binary_$( CEF_VER) _$( CEF_ARCH) _minimal
CEF_URL = http://opensource.spotify.com/cefbuilds/$( CEF_NAME) .tar.bz2
i f n e q ( $( CEF_ARCH ) , )
cef/$(CEF_NAME)/include/cef_version.h :
cd cef && wget -N $( CEF_URL)
cd cef && tar -xjf $( CEF_NAME) .tar.bz2
cef/$(CEF_NAME)/rel.zip : cef /$( CEF_NAME ) /include /cef_version .h
cd cef/$( CEF_NAME) /Release && zip -9 ../rel.zip *.dll *.bin
cd cef/$( CEF_NAME) /Resources && zip -r9 ../rel.zip .
$(OUT_DIR)/cef_$(CEF_VER).zip : cef /$( CEF_NAME ) /rel .zip
cp cef/$( CEF_NAME) /rel.zip $@
2019-09-04 07:59:40 +00:00
CEF_SOURCES = cef/cef.c plugin.c
2019-05-10 02:06:07 +00:00
$(PLUG_PREFIX)cef$(PLUG_NATIVE_EXT) : $( CEF_SOURCES ) $( OUT_DIR ) /cef_ $( CEF_VER ) .zip cef /$( CEF_NAME ) /include /cef_version .h
$( CC) $( BASE_CFLAGS) $( CFLAGS) -DFTEPLUGIN -o $( PLUG_PREFIX) cef$( PLUG_NATIVE_EXT) -shared $( PLUG_CFLAGS) -Icef/$( CEF_NAME) $( CEF_SOURCES) $( PLUG_DEFFILE) $( PLUG_LDFLAGS) -Wl,-rpath,. $( PLUG_LDFLAGS_DL)
2016-07-12 00:40:13 +00:00
#NATIVE_PLUGINS+=cef
2016-07-17 18:41:01 +00:00
e l s e
2019-05-10 02:06:07 +00:00
.PHONEY : $( PLUG_PREFIX ) cef $( PLUG_NATIVE_EXT )
$(PLUG_PREFIX)cef$(PLUG_NATIVE_EXT) :
2016-07-17 18:41:01 +00:00
echo cef plugin not supported on this arch
e n d i f
2013-06-23 18:43:59 +00:00
2019-09-04 07:59:40 +00:00
$(PLUG_PREFIX)irc$(PLUG_NATIVE_EXT) : irc /ircclient .c plugin .c
2016-07-12 00:40:13 +00:00
$( CC) $( BASE_CFLAGS) $( CFLAGS) -DFTEPLUGIN -o $@ -shared $( PLUG_CFLAGS) -Iirc $^ $( PLUG_DEFFILE) $( PLUG_LDFLAGS)
NATIVE_PLUGINS += irc
2013-06-23 18:43:59 +00:00
2015-06-03 16:42:37 +00:00
#for compat with ezquake
2019-09-04 07:59:40 +00:00
$(PLUG_PREFIX)ezhud$(PLUG_NATIVE_EXT) : ezhud /ezquakeisms .c ezhud /hud .c ezhud /hud_common .c ezhud /hud_editor .c plugin .c
2016-07-12 00:40:13 +00:00
$( CC) $( BASE_CFLAGS) $( CFLAGS) -DFTEPLUGIN -o $@ -shared $( PLUG_CFLAGS) -Iezhud $^ $( PLUG_DEFFILE) $( PLUG_LDFLAGS)
NATIVE_PLUGINS += ezhud
2015-06-03 16:42:37 +00:00
2019-09-04 09:15:13 +00:00
$(PLUG_PREFIX)models$(PLUG_NATIVE_EXT) : models /gltf .c models /exportiqm .c models /models .c plugin .c
2019-02-24 17:58:28 +00:00
$( CC) $( BASE_CFLAGS) $( CFLAGS) -DFTEPLUGIN -o $@ -shared $( PLUG_CFLAGS) -Imodels $^ $( PLUG_DEFFILE) $( PLUG_LDFLAGS)
#NATIVE_PLUGINS+=models
2019-09-04 07:59:40 +00:00
all : $( foreach FOO ,$ ( NATIVE_PLUGINS ) , $ ( PLUG_PREFIX ) $ ( FOO ) $ ( PLUG_NATIVE_EXT ) )