X-Git-Url: https://git.cameronkatri.com/ldid.git/blobdiff_plain/73deb88ab0152cc45ee1cb101293d2e7065be747..ecbe8537207f0e81960ecab4cb75bf79ad4397f5:/Makefile diff --git a/Makefile b/Makefile index 12b22c9..55a9c7a 100644 --- a/Makefile +++ b/Makefile @@ -14,13 +14,12 @@ PREFIX ?= /usr/local BINDIR ?= $(PREFIX)/bin MANDIR ?= $(PREFIX)/share/man -SRC := $(wildcard *.c) $(wildcard *.cpp) +SRC := ldid.cpp LIBS ?= -lcrypto -lplist-2.0 -all: ldid +MANPAGE_LANGS := zh_TW zh_CN -%.c.o: %.c - $(CC) -c $(CFLAGS) $(CPPFLAGS) -I. $< -o $@ +all: ldid %.cpp.o: %.cpp $(CXX) -c $(CXXFLAGS) $(CPPFLAGS) -I. -DLDID_VERSION=\"$(VERSION)\" $< -o $@ @@ -29,10 +28,15 @@ ldid: $(SRC:%=%.o) $(CXX) $(CXXFLAGS) -o ldid $^ $(LDFLAGS) $(LIBS) install: all - $(INSTALL) -D -m755 ldid $(DESTDIR)$(BINDIR)/ldid + $(INSTALL) -d $(DESTDIR)$(BINDIR)/ + $(INSTALL) -m755 ldid $(DESTDIR)$(BINDIR)/ldid $(LN) -sf ldid $(DESTDIR)$(BINDIR)/ldid2 - $(INSTALL) -D -m644 docs/ldid.1 $(DESTDIR)$(MANDIR)/man1/ldid.1 - $(INSTALL) -D -m644 docs/ldid.1.zh_TW $(DESTDIR)$(MANDIR)/zh_TW/man1/ldid.1 + $(INSTALL) -d $(DESTDIR)$(MANDIR)/man1/ + $(INSTALL) -m644 docs/ldid.1 $(DESTDIR)$(MANDIR)/man1/ldid.1 + for lang in $(MANPAGE_LANGS); do \ + $(INSTALL) -d $(DESTDIR)$(MANDIR)/$$lang/man1/; \ + $(INSTALL) -m644 docs/ldid.$$lang.1 $(DESTDIR)$(MANDIR)/$$lang/man1/ldid.1; \ + done clean: rm -rf ldid *.o