我不得不再次寻求帮助。我写了那个makefile,它适用于“int”,但不适用于“short”(为什么?)。那么空间呢(例如long long),因为当我这样做时它使用“long”而不是“long long”:make MFLAGS=-Dcost_type="\"long long\""
ifneq (,$(findstring short,$(MFLAGS)))
override MLAGS+=-Dcost_fmt=\"%hd\" -Dcost_max=SHRT_MAX
endif
ifneq (,$(findstring unsigned short,$(MFLAGS)))
override MFLAGS+=-Dcost_fmt=\"%hd\" -Dcost_max=USHRT_MAX
endif
ifneq (,$(findstring int,$(MFLAGS)))
override MFLAGS+=-Dcost_fmt=\"%d\" -Dcost_max=INT_MAX
endif
ifneq (,$(findstring unsigned int,$(MFLAGS)))
override MFLAGS+=-Dcost_fmt=\"%d\" -Dcost_max=UINT_MAX
endif
ifneq (,$(findstring long,$(MFLAGS)))
override MFLAGS+=-Dcost_fmt=\"%ld\" -Dcost_max=LONG_MAX
endif
ifneq (,$(findstring unsigned long,$(MFLAGS)))
override MFLAGS+=-Dcost_fmt=\"%ld\" -Dcost_max=ULONG_MAX
endif
ifneq (,$(findstring long long,$(MFLAGS)))
override MFLAGS+=-Dcost_fmt=\"%lld\" -Dcost_max=LLONG_MAX
endif
ifneq (,$(findstring unsigned long long,$(MFLAGS)))
override MFLAGS+=-Dcost_fmt=\"%lld\" -Dcost_max=ULLONG_MAX
endif
ifneq (,$(findstring float,$(MFLAGS)))
override MFLAGS+=-Dcost_fmt=\"%f\" -Dcost_max=FLT_MAX
endif
ifneq (,$(findstring double,$(MFLAGS)))
override MFLAGS+=-Dcost_fmt=\"%f\" -Dcost_max=DBL_MAX
endif
ifneq (,$(findstring long double,$(MFLAGS)))
override MFLAGS+=-Dcost_fmt=\"%Lf\" -Dcost_max=LDBL_MAX
endif