CFLAGS := -Wall -g OPENAIS_CPG := $(wildcard /usr/include/openais/cpg.h) ifneq ($(strip $(OPENAIS_CPG)),) CFLAGS += -DWHITETANK LIB64 := $(wildcard /usr/lib64/openais/libcpg.so) ifneq ($(strip $(LIB64)),) LDFLAGS += -L/usr/lib64/openais else LDFLAGS := -L/usr/lib/openais endif endif VER=$(shell cat VERSION) CFLAGS += -DVERSION=\"$(VER)\" all: cpgx cpgx: cpgx.o gcc $(LDFLAGS) -o $@ $^ -lcpg cpgx.o: cpgx.c gcc $(CFLAGS) -c -o $@ $< clean: rm -f *.o cpgx install: all install -D cpgx $(DESTDIR)/usr/bin/cpgx