makefile - How to filter out a file from wildcard match when an environment is not set -


i using gnu make.

i have version this:

mylist := $(filter-out $(if $(filter 1,$(exclude_file1)), file1.c),$(wildcard *.c)) 

it works well: when filter out "file1.c", set environment variable, exclude_file1.

now want opposite: when environment variable not set, want exclude file1.c.

could point me should change?

mylist := $(filter-out $(if $(filter undefined,$(origin exclude_file1)),,file1.c),$(wildcard *.c)) 

or

mylist := $(filter-out $(if $(filter-out undefined,$(origin exclude_file1)),file1.c),$(wildcard *.c)) 

or

mylist := $(filter-out $(if ${exclude_file1},,file1.c),$(wildcard *.c)) 

etc.

one advantage of first 2 formulations don't generate message when useful --warn-undefined-variables in effect.


Comments

Popular posts from this blog

php - Invalid Cofiguration - yii\base\InvalidConfigException - Yii2 -

How to show in django cms breadcrumbs full path? -

ruby on rails - npm error: tunneling socket could not be established, cause=connect ETIMEDOUT -