Advertisement
Guest User

Untitled

a guest
Jun 26th, 2017
46
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.83 KB | None | 0 0
  1. diff --git a/rules/pre/000-option-disabled.make b/rules/pre/000-option-disabled.make
  2. index 7ace5c9..19730e1 100644
  3. --- a/rules/pre/000-option-disabled.make
  4. +++ b/rules/pre/000-option-disabled.make
  5. @@ -20,7 +20,7 @@
  6. #
  7.  
  8. define ptx/opt-dis
  9. -$(firstword $(subst y,n,$(filter y,$($(strip $(1))))) y)
  10. +$(call ptx/ifdef,$(1),n,y)
  11. endef
  12.  
  13.  
  14. @@ -34,7 +34,7 @@ endef
  15. # $1, $2, $3
  16. #
  17. define ptx/ifdef
  18. -$(strip $(firstword $(subst y,$(2),$(filter y,$($(strip $(1))))) $(3)))
  19. +$(strip $(if $(filter y,$($(strip $(1)))),$(2),$(3)))
  20. endef
  21.  
  22.  
  23.  
  24. Zum testen:
  25.  
  26.  
  27. define ptx/ifdef
  28. $(strip $(if $(filter y,$($(strip $(1)))),$(2),$(3)))
  29. endef
  30.  
  31. OPT_YES=y
  32. # OPT_NO
  33.  
  34. all:
  35. echo $(call ptx/ifdef, OPT_YES,,#)
  36. echo $(call ptx/ifdef, OPT_NO,,#)
  37. echo $(call ptx/ifdef, OPT_YES,#,)
  38. echo $(call ptx/ifdef, OPT_NO,#,)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement