build: x64 stuff for makefiles

This commit is contained in:
bnnm 2023-01-15 21:10:44 +01:00
parent 2233cde3bd
commit 35fcbf2201
5 changed files with 24 additions and 7 deletions

View File

@ -10,6 +10,8 @@ else
endif endif
DEF_CFLAGS += -DVGMSTREAM_VERSION_AUTO -DVGM_LOG_OUTPUT DEF_CFLAGS += -DVGMSTREAM_VERSION_AUTO -DVGM_LOG_OUTPUT
VGM_X64=0
############################################################################### ###############################################################################
### external defs ### external defs
# currently aimed to WIN32 builds but vgmstream-cli should work for others (or use autotools instead) # currently aimed to WIN32 builds but vgmstream-cli should work for others (or use autotools instead)
@ -28,7 +30,13 @@ ifeq ($(TARGET_OS),Windows_NT)
STRIP = strip STRIP = strip
WINDRES = windres WINDRES = windres
DLLTOOL = dlltool DLLTOOL = dlltool
#DLLTOOL = dlltool -m i386:x86-64 --as-flags --64
DLL_DIR = .
export DLL_DIR
ifneq ($(VGM_X64),0)
DLLTOOL = dlltool -m i386:x86-64 --as-flags --64
DLL_DIR = dll-x64
endif
# same thing, the above should be available # same thing, the above should be available
#CC = i686-w64-mingw32-gcc #CC = i686-w64-mingw32-gcc
@ -86,6 +94,15 @@ LIBS_CFLAGS=
LIBS_LDFLAGS= LIBS_LDFLAGS=
LIBS_TARGET_EXT_LIBS= LIBS_TARGET_EXT_LIBS=
### bit stuff
# TODO: some targets don't work with X64 (Winamp, etc), detect
#ifneq ($(VGM_X86),0)
# DEF_CFLAGS += -m32
#endif
ifneq ($(VGM_X64),0)
DEF_CFLAGS += -m64
endif
# config libs # config libs
VGM_G7221 = 1 VGM_G7221 = 1
ifneq ($(VGM_G7221),0) ifneq ($(VGM_G7221),0)

View File

@ -18,7 +18,7 @@ ifeq ($(TARGET_OS),Windows_NT)
# -DUSE_ALLOCA # -DUSE_ALLOCA
CFLAGS += -DWIN32 -I../ext_includes -I../ext_libs/Getopt CFLAGS += -DWIN32 -I../ext_includes -I../ext_libs/Getopt
LDFLAGS += -L../ext_libs LDFLAGS += -L../ext_libs/$(DLL_DIR)
LIBAO_INC = -I$(LIBAO_IPATH) LIBAO_INC = -I$(LIBAO_IPATH)
LIBAO_LIB = -L$(LIBAO_LPATH) -lao LIBAO_LIB = -L$(LIBAO_LPATH) -lao

View File

@ -12,10 +12,10 @@
# -D is optional, but needed if DLL was renamed (like libcelts) # -D is optional, but needed if DLL was renamed (like libcelts)
# patterns match ($@ = target, $< = dependency, for others substitute) # patterns match ($@ = target, $< = dependency, for others substitute)
%.dll.a : %.def %.dll.a:
$(DLLTOOL) -D $(patsubst %.def,%.dll,$<) -d $< -l $@ $(DLLTOOL) -D $(DLL_DIR)/$(patsubst %.dll.a,%.dll,$@) -d $(DLL_DIR)/$(patsubst %.dll.a,%.def,$@) -l $(DLL_DIR)/$@
clean: clean:
$(RMF) *.dll.a $(RMF) $(DLL_DIR)/*.dll.a
.PHONY: clean .PHONY: clean

View File

@ -23,7 +23,7 @@ OUTPUT_WINAMP = in_vgmstream.dll
ifeq ($(TARGET_OS),Windows_NT) ifeq ($(TARGET_OS),Windows_NT)
CFLAGS += -DWIN32 -m32 -DUSE_ALLOCA -I../ext_includes CFLAGS += -DWIN32 -m32 -DUSE_ALLOCA -I../ext_includes
LDFLAGS += -L../ext_libs LDFLAGS += -L../ext_libs/$(DLL_DIR)
endif endif
CFLAGS += $(LIBS_CFLAGS) CFLAGS += $(LIBS_CFLAGS)

View File

@ -21,7 +21,7 @@ ifeq ($(TARGET_OS),Windows_NT)
endif endif
CFLAGS += $(DEF_CFLAGS) -I../ext_includes $(EXTRA_CFLAGS) CFLAGS += $(DEF_CFLAGS) -I../ext_includes $(EXTRA_CFLAGS)
LDFLAGS += -L../src -L../ext_libs -lvgmstream -lm $(EXTRA_LDFLAGS) LDFLAGS += -L../src -L../ext_libs/$(DLL_DIR) -lvgmstream -lm $(EXTRA_LDFLAGS)
TARGET_EXT_LIBS = TARGET_EXT_LIBS =
CFLAGS += $(LIBS_CFLAGS) CFLAGS += $(LIBS_CFLAGS)