Language make
(GNU version, no shell commands)
Date: | 07/30/10 |
Author: | wrtlprnft |
URL: | n/a |
Comments: | 0 |
Info: | n/a |
Score: | (3.75 in 4 votes) |
#!/usr/bin/make -qf BOTTLES := 99 define BOTTLE $(if $(1),$(if $(word 2,$(1)),$(words $(1)) bottles,1 bottle),no more bottles) endef define VERSE $(call BOTTLE,$(1) .) of beer on the wall, $(call BOTTLE,$(1) .) of beer. Take one down and pass it around, $(call BOTTLE,$(1)) on the wall. endef define LASTVERSE No more bottles of beer on the wall, no more bottles of beer. Go to the store and buy some more, $(BOTTLES) bottles of beer on the wall. endef define SONG $(if $(word $(BOTTLES),$(1) .),,$(call SONG,$(1) .))$(call VERSE,$(1)) endef $(info $(SONG)$(LASTVERSE)) .PHONY: all all:
Download Source | Write Comment
Alternative Versions
Version | Author | Date | Comments | Rate |
---|---|---|---|---|
make syntax,portable,simple,dependencies | rahul | 03/17/08 | 0 | |
2 | Andrew Dunstan | 04/20/05 | 3 |
Download Source | Write Comment
Add Comment
Please provide a value for the fields Name,
Comment and Security Code.
This is a gravatar-friendly website.
E-mail addresses will never be shown.
Enter your e-mail address to use your gravatar.
Please don't post large portions of code here! Use the form to submit new examples or updates instead!
Comments