help-make
[Top][All Lists]
Advanced

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

combining $(eval) with $(shell)


From: Adam Kellas
Subject: combining $(eval) with $(shell)
Date: Mon, 9 Sep 2013 17:45:29 -0700

I'm having a problem using these two together. There's a program which
spits out a series of variable assignments so I need $(shell) to
invoke it, but the shell function strips newlines which garbles the
result. Example below. Ideas?

% cat Makefile
$(eval $(shell ./vars.sh))

.PHONY: all
all:
        @echo VAR1=$(VAR1)
        @echo VAR2=$(VAR2)

% cat ./vars.sh
#!/bin/sh
echo "VAR1=val1"
echo "VAR2=val2"

% make
VAR1=val1 VAR2=val2
VAR2=



reply via email to

[Prev in Thread] Current Thread [Next in Thread]