]> git.cameronkatri.com Git - ldid.git/blob - Makefile
ldid.1: Update to reflect -d changes
[ldid.git] / Makefile
1 VERSION ?= 2.1.5
2
3 CC ?= cc
4 CXX ?= c++
5 INSTALL ?= install
6 LN ?= ln
7
8 CXXFLAGS ?= -std=c++11 -O2 -pipe
9 LDFLAGS ?=
10
11 PREFIX ?= /usr/local
12
13 BINDIR ?= $(PREFIX)/bin
14 MANDIR ?= $(PREFIX)/share/man
15
16 SRC := ldid.cpp
17 LIBS ?= -lcrypto -lplist-2.0
18
19 MANPAGE_LANGS := zh_TW zh_CN
20
21 all: ldid
22
23 %.cpp.o: %.cpp
24 $(CXX) -c $(CXXFLAGS) $(CPPFLAGS) -I. -DLDID_VERSION=\"$(VERSION)\" $< -o $@
25
26 ldid: $(SRC:%=%.o)
27 $(CXX) $(CXXFLAGS) -o ldid $^ $(LDFLAGS) $(LIBS)
28
29 install: all
30 $(INSTALL) -d $(DESTDIR)$(BINDIR)/
31 $(INSTALL) -m755 ldid $(DESTDIR)$(BINDIR)/ldid
32 $(LN) -sf ldid $(DESTDIR)$(BINDIR)/ldid2
33 $(INSTALL) -d $(DESTDIR)$(MANDIR)/man1/
34 $(INSTALL) -m644 docs/ldid.1 $(DESTDIR)$(MANDIR)/man1/ldid.1
35 for lang in $(MANPAGE_LANGS); do \
36 $(INSTALL) -d $(DESTDIR)$(MANDIR)/$$lang/man1/; \
37 $(INSTALL) -m644 docs/ldid.$$lang.1 $(DESTDIR)$(MANDIR)/$$lang/man1/ldid.1; \
38 done
39
40 clean:
41 rm -rf ldid *.o
42
43 .PHONY: all clean install