Skip to content

Commit bb86319

Browse files
committed
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
1 parent f7af208 commit bb86319

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

Makefile

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,8 @@ WIIKEYBLIBOBJ := usbkeyboard.o keyboard.o ukbdmap.o wskbdutil.o
186186

187187

188188

189-
all: wii cube
189+
PLATFORMS ?= wii cube
190+
all: $(PLATFORMS)
190191

191192
#---------------------------------------------------------------------------------
192193
wii: gc/ogc/libversion.h
@@ -298,7 +299,7 @@ install-headers: gc/ogc/libversion.h
298299
@cp $(BASEDIR)/gc/wiikeyboard/*.h $(INCDIR)/wiikeyboard
299300

300301
#---------------------------------------------------------------------------------
301-
install: wii cube install-headers
302+
install: $(PLATFORMS) install-headers
302303
#---------------------------------------------------------------------------------
303304
@mkdir -p $(DESTDIR)$(DEVKITPRO)/libogc2
304305
@cp -frv include $(DESTDIR)$(DEVKITPRO)/libogc2
@@ -312,7 +313,7 @@ uninstall:
312313
@rm -frv $(DESTDIR)$(DEVKITPRO)/libogc2
313314

314315
#---------------------------------------------------------------------------------
315-
dist: wii cube install-headers
316+
dist: $(PLATFORMS) install-headers
316317
#---------------------------------------------------------------------------------
317318
@tar -C $(BASEDIR) --exclude-vcs --exclude-vcs-ignores --exclude .github \
318319
-cvjf $(BUILDDIR)/libogc2-src-$(VERSTRING).tar.bz2 .
@@ -321,17 +322,19 @@ dist: wii cube install-headers
321322
@tar -cvjf libogc2-$(VERSTRING).tar.bz2 include lib libogc_license.txt gamecube_rules wii_rules
322323

323324

324-
LIBRARIES := $(OGCLIB).a $(MODLIB).a $(DBLIB).a $(TINYSMBLIB).a $(ASNDLIB).a $(AESNDLIB).a $(ISOLIB).a
325+
ifeq ($(strip $(LIBRARIES)),)
326+
LIBRARIES := ogc modplay db tinysmb asnd aesnd iso9660
325327

326328
ifeq ($(PLATFORM),cube)
327-
LIBRARIES += $(BBALIB).a
329+
LIBRARIES += bba
328330
endif
329331
ifeq ($(PLATFORM),wii)
330-
LIBRARIES += $(BTELIB).a $(WIIUSELIB).a $(DILIB).a $(WIIKEYBLIB).a
332+
LIBRARIES += bte wiiuse di wiikeyboard
333+
endif
331334
endif
332335

333336
#---------------------------------------------------------------------------------
334-
libs: $(LIBRARIES)
337+
libs: $(foreach lib,$(LIBRARIES),$(LIBDIR)/lib$(lib).a)
335338
#---------------------------------------------------------------------------------
336339

337340
#---------------------------------------------------------------------------------

0 commit comments

Comments
 (0)