Skip to content

Commit

Permalink
Update numeric.mk to match other projects.
Browse files Browse the repository at this point in the history
(Fixes some issues with make 3.8x)
  • Loading branch information
RhodiumToad committed Nov 29, 2023
1 parent 231e567 commit b31b751
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 3 deletions.
19 changes: 19 additions & 0 deletions tools/numeric-tests.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
##

include tools/numeric.mk

define assert
$(if $1,,$(error assert failed: $2))
endef

define assert_n
$(if $1,$(error assert_n failed: $2),)
endef

.PHONY: tools_test_numeric

tools_test_numeric:
$(call assert_n,$(call version_ge,9.0,9.1))
$(call assert,$(call version_ge,9.2,9.1))
$(call assert,$(call version_ge,9.0,9.0))
$(call assert_n,$(call version_ge,9.4,13))
4 changes: 1 addition & 3 deletions tools/numeric.mk
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@ $(if $(strip $(1)),
t,
$(if $(call numeric_lt,$(firstword $(1)),$(firstword $(2))),
,
$(call vge_2,
$(wordlist 2,$(words $(1)),$(1)),
$(wordlist 2,$(words $(2)),$(2))))),
$(call vge_2,$(wordlist 2,$(words $(1)),$(1)),$(wordlist 2,$(words $(2)),$(2))))),
t),
$(if $(strip $(2)),,t))
endef
Expand Down

0 comments on commit b31b751

Please sign in to comment.