From ee634d3243aff11134cd892b8794c442b89b6a8e Mon Sep 17 00:00:00 2001 From: novenary Date: Wed, 29 Nov 2023 22:24:26 +0200 Subject: [PATCH] Allow selective building of libraries and platforms make -C build -f ../Makefile -j10 90.11s user 8.46s system 746% cpu 13.207 total make -C build -f ../Makefile -j10 PLATFORMS=cube LIBRARIES=ogc 19.28s user 1.93s system 586% cpu 3.619 total --- Makefile | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index c875d4f3..eeac4228 100644 --- a/Makefile +++ b/Makefile @@ -186,7 +186,8 @@ WIIKEYBLIBOBJ := usbkeyboard.o keyboard.o ukbdmap.o wskbdutil.o -all: wii cube +PLATFORMS ?= wii cube +all: $(PLATFORMS) #--------------------------------------------------------------------------------- wii: gc/ogc/libversion.h @@ -296,7 +297,7 @@ install-headers: gc/ogc/libversion.h @cp $(BASEDIR)/gc/wiikeyboard/*.h $(INCDIR)/wiikeyboard #--------------------------------------------------------------------------------- -install: wii cube install-headers +install: $(PLATFORMS) install-headers #--------------------------------------------------------------------------------- @mkdir -p $(DESTDIR)$(DEVKITPRO)/libogc2 @cp -frv include $(DESTDIR)$(DEVKITPRO)/libogc2 @@ -310,7 +311,7 @@ uninstall: @rm -frv $(DESTDIR)$(DEVKITPRO)/libogc2 #--------------------------------------------------------------------------------- -dist: wii cube install-headers +dist: $(PLATFORMS) install-headers #--------------------------------------------------------------------------------- @tar -C $(BASEDIR) --exclude-vcs --exclude-vcs-ignores --exclude .github \ -cvjf $(BUILDDIR)/libogc2-src-$(VERSTRING).tar.bz2 . @@ -319,17 +320,19 @@ dist: wii cube install-headers @tar -cvjf libogc2-$(VERSTRING).tar.bz2 include lib libogc_license.txt gamecube_rules wii_rules -LIBRARIES := $(OGCLIB).a $(MODLIB).a $(DBLIB).a $(TINYSMBLIB).a $(ASNDLIB).a $(AESNDLIB).a $(ISOLIB).a +ifeq ($(LIBRARIES),) +LIBRARIES := ogc modplay db tinysmb asnd aesnd iso9660 ifeq ($(PLATFORM),cube) -LIBRARIES += $(BBALIB).a +LIBRARIES += bba endif ifeq ($(PLATFORM),wii) -LIBRARIES += $(BTELIB).a $(WIIUSELIB).a $(DILIB).a $(WIIKEYBLIB).a +LIBRARIES += bte wiiuse di wiikeyboard +endif endif #--------------------------------------------------------------------------------- -libs: $(LIBRARIES) +libs: $(foreach lib,$(LIBRARIES),$(LIBDIR)/lib$(lib).a) #--------------------------------------------------------------------------------- #---------------------------------------------------------------------------------