Thursday, September 10, 2009

makefile condition

If you need conditionl instruction in Makefile this is a example

KNL_VER:= $(shell uname -r)
KNL_MAJOR:= $(shell echo $(KNL_VER) | cut -c -3)

LDFLAGS = -p
RV = 2.6



ifeq ($(KNL_MAJOR), $(RV))
LDFLAGS = -lm
else
LDFLAGS = -lc
endif

No comments: