summaryrefslogtreecommitdiffstats
path: root/cpgx/Makefile
blob: 9eb375337fa4d90ff5009988ee8d178327eed5ef (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31

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