forked from ProcursusTeam/ldid
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
44 lines (31 loc) · 927 Bytes
/
Makefile
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
32
33
34
35
36
37
38
39
40
41
42
43
44
VERSION ?= 2.1.5
CC ?= cc
CXX ?= c++
INSTALL ?= install
LN ?= ln
CFLAGS ?= -O2 -pipe
CXXFLAGS ?= $(CFLAGS) -std=c++11
LDFLAGS ?=
PREFIX ?= /usr/local
BINDIR ?= $(PREFIX)/bin
MANDIR ?= $(PREFIX)/share/man
SRC := $(wildcard *.c) $(wildcard *.cpp)
LIBS ?= -lcrypto -lplist-2.0
MANPAGE_LANGS := zh_TW zh_CN
all: ldid
%.c.o: %.c
$(CC) -c $(CFLAGS) $(CPPFLAGS) -I. $< -o $@
%.cpp.o: %.cpp
$(CXX) -c $(CXXFLAGS) $(CPPFLAGS) -I. -DLDID_VERSION=\"$(VERSION)\" $< -o $@
ldid: $(SRC:%=%.o)
$(CXX) $(CXXFLAGS) -o ldid $^ $(LDFLAGS) $(LIBS)
install: all
$(INSTALL) -D -m755 ldid $(DESTDIR)$(BINDIR)/ldid
$(LN) -sf ldid $(DESTDIR)$(BINDIR)/ldid2
$(INSTALL) -D -m644 docs/ldid.1 $(DESTDIR)$(MANDIR)/man1/ldid.1
for lang in $(MANPAGE_LANGS); do \
$(INSTALL) -D -m644 docs/ldid.$$lang.1 $(DESTDIR)$(MANDIR)/$$lang/man1/ldid.1; \
done
clean:
rm -rf ldid *.o
.PHONY: all clean install