[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Environment variables, debian/rules and dpkg-buildpackage



On Mon, Mar 16, 2009 at 06:37:40PM +0100, Raphael Hertzog wrote:
> Suppose you have "FOO ?= bar" in the Makefile, write me the rest of the
> Makefile so that I have this:
> $ FOO=foo make
> FOO was set in the environment
> $ make FOO=foo
> FOO was set on the command-line
> $ make
> FOO was set in the Makefile

$ cat Makefile
FOO ?= bar
all:
ifeq "$(origin FOO)" "command line"
	$(info "FOO was set on the command-line")
endif
ifeq "$(origin FOO)" "environment"
	$(info "FOO was set in the environment")
endif
ifeq "$(origin FOO)" "file"
	$(info "FOO was set in the Makefile")
endif

-- 
James
GPG Key: 1024D/61326D40 2003-09-02 James Vega <jamessan@debian.org>

Attachment: signature.asc
Description: Digital signature


Reply to: