Skip to content

Commit

Permalink
Allow selective building of libraries and platforms
Browse files Browse the repository at this point in the history
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
  • Loading branch information
9ary committed Nov 29, 2023
1 parent 649ca8b commit ee634d3
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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 .
Expand All @@ -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)
#---------------------------------------------------------------------------------

#---------------------------------------------------------------------------------
Expand Down

0 comments on commit ee634d3

Please sign in to comment.