>> and please leave the -static-libgcc -static-libstdc++ flags for brush and radiant
> can you tell me why this is needed? this isn't needed for cross-compile with mingw-cross-env
You do a static build on mingw-cross-env
that is the reason why you dont need it
But on Windows we still use shared libs
that is the reason why we need it
This parameter wont interfere with a static build (you include it because of -static)
but is is needed for a shared build
===========================================================================
The make pk3 error
can be fixed in to ways
This will force make to use zip on windows instead of 7z or 7za
Why: Because 7z is unable to handle a large parameter list, while zip does its job
This is as slow as usual
but -j3 will help (on a dual core)
define ZIP
- $(shell ([ -x "$$(which 7z 2> /dev/null)" -a $(OS) != "Windows_NT" ] && echo "7z a -tzip -mx=9") || ([ -x "$$(which 7z 2> /dev/null)" -a $(OS) != "Windows_NT" ] && echo "7z a -tzip -mx=9") || ([ -x "$$(which zip 2> /dev/null)" ] && echo "zip -u9"))
+ $(shell ([ $$OS != Windows_NT -a -x "$$(which 7z 2> /dev/null)" ] && echo "7z a -tzip -mx=9") || ([ $$OS != Windows_NT -a -x "$$(which 7za 2> /dev/null)" ] && echo "7za a -tzip -mx=9") || ([ -x "$$(which zip 2> /dev/null)" ] && echo "zip -u9"))
endef
This will use the internal search algorithm of 7z and zip to find all files
Its a lot faster, because make.exe dont need to do a lot of string manipulation
Make.exe is slow on windows (single threaded)
include build/pk3_def.mk
BASE_DIR = base
PAK_FILES_OUT = $(addprefix $(BASE_DIR)/,$(PAK_FILES))
pk3: $(PAK_FILES_OUT)
clean-pk3:
$(Q)rm -f $(PAK_FILES_OUT)
define FIND
$(shell find $(BASE_DIR)/$(1) -type f -print)
endef
define ZIP
$(shell ([ -x "$$(which 7z 2> /dev/null)" ] && echo "7z u -tzip -mx=9") || ([ -x "$$(which 7za 2> /dev/null)" ] && echo "7za u -tzip -mx=9") || ([ -x "$$(which zip 2> /dev/null)" ] && echo "zip -u9"))
endef
%.pk3 :
ifeq (7z,$(findstring 7z,$(call ZIP)))
ifeq ($(OS),Windows_NT)
$(Q)cd $(BASE_DIR) ; cmd /c "$(call ZIP) $(filter -r,$(call $@)) $(notdir $@) $(filter-out -r,$(call $@))"
else
$(Q)cd $(BASE_DIR) ; $(call ZIP) $(filter -r,$(call $@)) $(notdir $@) $(filter-out -r,$(call $@))
endif
else
$(Q)cd $(BASE_DIR) ; $(call ZIP) $(filter -r,$(call $@)) $(notdir $@) . -i $(subst *,\*,$(filter-out -r,$(call $@)))
endif
define $(BASE_DIR)/0pics.pk3
-r pics/*.jpg pics/*.tga pics/*.png
endef
define $(BASE_DIR)/0textures.pk3
-r textures/*.jpg textures/*.tga textures/*.png
endef
define $(BASE_DIR)/0models.pk3
-r models/*.mdx models/*.md2 models/*.md3 models/*.dpm models/*.obj models/*.jpg models/*.png models/*.tga models/*.anm models/*.tag
endef
define $(BASE_DIR)/0models.pk3
-r models/*.mdx models/*.md2 models/*.md3 models/*.dpm models/*.obj models/*.jpg models/*.png models/*.tga models/*.anm models/*.tag
endef
define $(BASE_DIR)/0snd.pk3
-r sound/*.ogg sound/*.wav
endef
define $(BASE_DIR)/0music.pk3
music/*.ogg
endef
define $(BASE_DIR)/0maps.pk3
-r maps/*.bsp maps/*.ump
endef
define $(BASE_DIR)/0videos.pk3
-r videos/*.roq videos/*.ogm
endef
define $(BASE_DIR)/0media.pk3
media/*.ttf
endef
define $(BASE_DIR)/0shaders.pk3
shaders/*.glsl
endef
define $(BASE_DIR)/0ufos.pk3
-r ufos/*.ufo
endef
define $(BASE_DIR)/0materials.pk3
materials/*.mat
endef
define $(BASE_DIR)/0base.pk3
*.cfg mapcycle.txt irc_motd.txt ai/*.lua
endef