Hi

I am creating Makefile and it gives me following error

Makefile:124: *** unterminated call to function `foreach': missing `)'.  Stop.

The Makefile around line 124 is

.PHONY: popiso
popiso: isolinux_cfg $(foreach x,$(_$(country)_pops_roles), pop_iso_$(x))  $(isomedia)
        @echo $@
        @echo
        @echo allhostname $(allhostname)
        @echo
        @echo
        @echo allnetwork_setup $(allnetwork_setup)
        @sudo cp $(addsuffix .ks.cfg,$(allhostname)) $(isomedia)
        @sudo cp isolinux.cfg $(isomedia)/isolinux/
        @echo ready to make iso

$(_$(country)_pops_roles) gets expanded correctly and it calls pop_iso_XXXX 4 times as it suppose to.
And then it gives above mentioned error.

I'm using RHEL6 - 64bit machine
I'm not that deep into Makefile/Gmake, and so I'm not sure what's the issue.

Hemanshu

My guess is that there is a hidden file in the directory which the shell is not able to expand, resulting in the error. Check for that.

Well nothing like that, I did check. I did run make with debug, it doesnt give any error and yet it fails.
the strange part is, that if I replace

popiso: isolinux_cfg $(foreach x,$(_$(country)_pops_roles), pop_iso_$(x)) $(isomedia)

with

popiso: 
    @echo testing

error stays the same.How can this be?
This means error is due to some other part and its, just showing this line due to god knows what.

Do you have any foreach loops before line 124? While line 124 is the one with the reported error, the cause of the error could be before it.

Nope there is none.
I'm not sure what this error is but running make file with -i (ignore error) flags, makes it to run and generate final product successfully.

So this error, doesnt effect anything that is to be generated via make.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.