Skip to content

Commit

Permalink
Merge 'dev' ~ build (Makefile.win) improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
rivy committed Sep 15, 2020
2 parents f34003a + 7e54703 commit 6df2c7c
Show file tree
Hide file tree
Showing 3 changed files with 200 additions and 182 deletions.
15 changes: 15 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Makefile (pass-through)
# Cross-platform (bash/sh + CMD/PowerShell)
# GNU make (gmake) compatible; ref: <https://www.gnu.org/software/make/manual>

# ref: https://stackoverflow.com/a/14061796/43774

OSID := $(or $(and $(filter .exe,$(patsubst %.exe,.exe,$(subst $() $(),_,${SHELL}))),$(filter win,${OS:Windows_NT=win})),nix)## OSID == [nix,win]

# gather all goals/targets as arguments; creating an empty rule for each word (which avoids multiple calls to sub-make)
ARGS := $(wordlist 1,$(words $(MAKECMDGOALS)),$(MAKECMDGOALS))
$(eval $(ARGS):_undefined_;@:)

_default: .DEFAULT
.DEFAULT:
$(if $(filter win,${OSID}),${MAKE} -f Makefile.win ${ARGS}, ./configure && ${MAKE} ${ARGS})
Loading

0 comments on commit 6df2c7c

Please sign in to comment.