1 ifneq (,$(wildcard .git))
2 VERSION ?= $(shell git describe --tags)
4 VERSION ?= 2.1.5-procursus3
17 BINDIR ?= $(PREFIX)/bin
18 MANDIR ?= $(PREFIX)/share/man
23 LIBPLIST_INCLUDES ?= $(shell pkg-config --cflags libplist-2.0)
24 LIBPLIST_LIBS ?= $(shell pkg-config --libs libplist-2.0)
26 ifeq ($(shell uname -s),FreeBSD)
27 LIBCRYPTO_INCLUDES ?= -I/usr/include
28 LIBCRYPTO_LIBS ?= -L/usr/lib -lcrypto
30 LIBCRYPTO_INCLUDES ?= $(shell pkg-config --cflags libcrypto)
31 LIBCRYPTO_LIBS ?= $(shell pkg-config --libs libcrypto)
34 MANPAGE_LANGS := zh_TW zh_CN
39 $(CXX) -c -std=c++11 $(CXXFLAGS) $(LIBCRYPTO_INCLUDES) $(LIBPLIST_INCLUDES) $(CPPFLAGS) -I. -DLDID_VERSION=\"$(VERSION)\" $< -o $@
42 $(CXX) -o ldid $^ $(LDFLAGS) $(LIBCRYPTO_LIBS) $(LIBPLIST_LIBS) $(LIBS)
45 $(INSTALL) -d $(DESTDIR)$(BINDIR)/
46 $(INSTALL) -m755 ldid $(DESTDIR)$(BINDIR)/ldid
47 $(LN) -sf ldid $(DESTDIR)$(BINDIR)/ldid2
48 $(INSTALL) -d $(DESTDIR)$(MANDIR)/man1/
49 $(INSTALL) -m644 docs/ldid.1 $(DESTDIR)$(MANDIR)/man1/ldid.1
50 for lang in $(MANPAGE_LANGS); do \
51 $(INSTALL) -d $(DESTDIR)$(MANDIR)/$$lang/man1/; \
52 $(INSTALL) -m644 docs/ldid.$$lang.1 $(DESTDIR)$(MANDIR)/$$lang/man1/ldid.1; \
58 .PHONY: all clean install