rubricanis
Homo ludens
Ich möchte in einem gmake Makefile 3 parameter zur Konfiguration unterschieden, die ich hier mal aaa, bbb und ccc nenne. Auf der Kommandozeile soll das also so aussehen: gmake config=xxx. Hier ist der Code wie ich das z.Z. löse, aber das erscheint mir doch recht umständlich und unelegant. Gibt es da eine bessere Lösung ?
Code:
# config = aaa | bbb | ccc
ifndef config
CFG := aaa
else
# aaa
ifeq ($(config),aaa)
CFG := aaa
endif
# ccc
ifeq ($(config),ccc)
CFG := ccc
endif
#bbb
ifeq ($(config),bbb)
CFG := bbb
endif
# error
endif
ifndef CFG
$(error Config may be aaa, bbb or ccc, default is aaa.)
endif
[code]