switchbrew / switch-examples

Switch examples for devkitA64 and libnx.
https://devkitpro.org/viewforum.php?f=42
559 stars 99 forks source link

Add targets per Makefile, allowing make -j to work #86

Closed endrift closed 3 years ago

endrift commented 3 years ago

As the commit log says, this breaks out the MAKEFILES variable instead into a list of directories that have Makefiles in them, which allows for a multi-target rule over the set of those directories. Without this, make -j cannot build more than one subdirectory at a time, which was somewhat frustrating to me. It also lets you say, e.g., make audio/echo to just build the audio/echo example while in the root directory.

This doesn't attempt to apply the same cleanup to the clean target since cleaning is much faster and I didn't want to get fiddly with more string substitutions; it didn't seem worth it to clean up that loop too.

WinterMute commented 3 years ago

-printf isn't available on macOS find I'm afraid.

% make -j4
find: -printf: unknown primary or operator
endrift commented 3 years ago

I swear I checked this on FreeBSD first, but apparently not since it doesn't exist there either.

WinterMute commented 3 years ago

https://github.com/switchbrew/switch-examples/commit/fc98393d50e7896fcc8d59295516c2d1640f043f does the job. Tested on macOS/linux/windows and I presume it will work on FreeBSD too. Would be grateful if you'd check when you have time.