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