]> git.cameronkatri.com Git - ldid.git/blob - Makefile
Use OpenSSL 1.1.1 in GH actions for now
[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 := $(wildcard *.c) $(wildcard *.cpp)
18 LIBS ?= -lcrypto -lplist-2.0
19
20 MANPAGE_LANGS := zh_TW zh_CN
21
22 all: ldid
23
24 %.c.o: %.c
25 $(CC) -c $(CFLAGS) $(CPPFLAGS) -I. $< -o $@
26
27 %.cpp.o: %.cpp
28 $(CXX) -c $(CXXFLAGS) $(CPPFLAGS) -I. -DLDID_VERSION=\"$(VERSION)\" $< -o $@
29
30 ldid: $(SRC:%=%.o)
31 $(CXX) $(CXXFLAGS) -o ldid $^ $(LDFLAGS) $(LIBS)
32
33 install: all
34 $(INSTALL) -D -m755 ldid $(DESTDIR)$(BINDIR)/ldid
35 $(LN) -sf ldid $(DESTDIR)$(BINDIR)/ldid2
36 $(INSTALL) -D -m644 docs/ldid.1 $(DESTDIR)$(MANDIR)/man1/ldid.1
37 for lang in $(MANPAGE_LANGS); do \
38 $(INSTALL) -D -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