From 2ea0932726af8e3710e3781f196cb4a9fc98f61a Mon Sep 17 00:00:00 2001 From: Roy Merkel Date: Sat, 13 Apr 2024 09:24:19 -0700 Subject: [PATCH] Fixed windows cmd build (LIB overrides msvc-clang/clang-cl libpath.) --- Makefile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index cbd020660..912c4fadc 100644 --- a/Makefile +++ b/Makefile @@ -100,7 +100,7 @@ CONF ?= debug BIN := build/bin OBJ := build/obj INC := build/include/sameboy -LIB := build/lib +LIBDIR := build/lib BOOTROMS_DIR ?= $(BIN)/BootROMs @@ -331,7 +331,7 @@ ios-deb: $(BIN)/SameBoy-iOS.deb ifeq ($(PLATFORM),windows32) lib: lib-unsupported else -lib: $(LIB)/libsameboy.o $(LIB)/libsameboy.a +lib: $(LIBDIR)/libsameboy.o $(LIBDIR)/libsameboy.a endif all: sdl tester libretro lib ifeq ($(PLATFORM),Darwin) @@ -717,7 +717,7 @@ $(OBJ)/debian-binary: -@$(MKDIR) -p $(dir $@) echo 2.0 > $@ -$(LIB)/libsameboy.o: $(CORE_OBJECTS) +$(LIBDIR)/libsameboy.o: $(CORE_OBJECTS) -@$(MKDIR) -p $(dir $@) @# This is a somewhat simple hack to force Clang and GCC to build a native object file out of one or many LTO objects echo "static const char __attribute__((used)) x=0;"| $(CC) $(filter-out -flto,$(CFLAGS)) -c -x c - -o $(OBJ)/lto_hack.o @@ -725,7 +725,7 @@ $(LIB)/libsameboy.o: $(CORE_OBJECTS) $(CC) $(FAT_FLAGS) $(CFLAGS) $(LIBFLAGS) $^ $(OBJ)/lto_hack.o -o $@ -@rm $(OBJ)/lto_hack.o -$(LIB)/libsameboy.a: $(LIB)/libsameboy.o +$(LIBDIR)/libsameboy.a: $(LIBDIR)/libsameboy.o -@$(MKDIR) -p $(dir $@) -@rm -f $@ ar -crs $@ $^