diff options
-rw-r--r-- | Makefile | 32 |
1 files changed, 30 insertions, 2 deletions
@@ -298,6 +298,8 @@ LIB=lib INSTALL=install MKDIR=mkdir +EXTRA_FILES= +CLIENT_EXTRA_FILES= ifneq (,$(findstring "$(PLATFORM)", "linux" "gnu_kfreebsd" "kfreebsd-gnu")) @@ -472,6 +474,7 @@ ifeq ($(PLATFORM),darwin) CLIENT_LIBS += -framework IOKit \ $(LIBSDIR)/macosx/libSDL2-2.0.0.dylib RENDERER_LIBS += -framework OpenGL $(LIBSDIR)/macosx/libSDL2-2.0.0.dylib + CLIENT_EXTRA_FILES=$(LIBSDIR)/macosx/libSDL2-2.0.0.dylib OPTIMIZE = $(OPTIMIZEVM) -ffast-math @@ -615,12 +618,14 @@ ifeq ($(PLATFORM),mingw32) RENDERER_LIBS += $(LIBSDIR)/win32/libSDL2main.a \ $(LIBSDIR)/win32/libSDL2.dll.a SDLDLL=SDL2.dll + CLIENT_EXTRA_FILES += $(LIBSDIR)/win32/SDL2.dll else CLIENT_LIBS += $(LIBSDIR)/win64/libSDL264main.a \ $(LIBSDIR)/win64/libSDL264.dll.a RENDERER_LIBS += $(LIBSDIR)/win64/libSDL264main.a \ $(LIBSDIR)/win64/libSDL264.dll.a SDLDLL=SDL264.dll + CLIENT_EXTRA_FILES += $(LIBSDIR)/win64/SDL264.dll endif else CLIENT_CFLAGS += $(SDL_CFLAGS) @@ -919,12 +924,12 @@ endif ifneq ($(BUILD_CLIENT),0) ifneq ($(USE_RENDERER_DLOPEN),0) TARGETS += $(B)/$(CLIENTBIN)$(FULLBINEXT) $(B)/renderer_opengl1_$(SHLIBNAME) - ifneq ($(BUILD_RENDERER_OPENGL2), 0) + ifneq ($(BUILD_RENDERER_OPENGL2),0) TARGETS += $(B)/renderer_opengl2_$(SHLIBNAME) endif else TARGETS += $(B)/$(CLIENTBIN)$(FULLBINEXT) - ifneq ($(BUILD_RENDERER_OPENGL2), 0) + ifneq ($(BUILD_RENDERER_OPENGL2),0) TARGETS += $(B)/$(CLIENTBIN)_opengl2$(FULLBINEXT) endif endif @@ -1181,6 +1186,29 @@ else TERM_COLUMNS=76 endif +define ADD_COPY_TARGET +TARGETS += $2 +$2: $1 + $(echo_cmd) "CP $$<" + @cp $1 $2 +endef + +# These functions allow us to generate rules for copying a list of files +# into the base directory of the build; this is useful for bundling libs, +# README files or whatever else +define GENERATE_COPY_TARGETS +$(foreach FILE,$1, \ + $(eval $(call ADD_COPY_TARGET, \ + $(FILE), \ + $(addprefix $(B)/,$(notdir $(FILE)))))) +endef + +$(call GENERATE_COPY_TARGETS,$(EXTRA_FILES)) + +ifneq ($(BUILD_CLIENT),0) + $(call GENERATE_COPY_TARGETS,$(CLIENT_EXTRA_FILES)) +endif + NAKED_TARGETS=$(shell echo $(TARGETS) | sed -e "s!$(B)/!!g") print_list=@for i in $(1); \ |