BINDIR ?= $(PREFIX)/bin
MANDIR ?= $(PREFIX)/share/man
-SRC := $(wildcard *.c) $(wildcard *.cpp)
+SRC := ldid.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 $@
$(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 $(DESTDIR)$(MANDIR)/man1/
+ $(INSTALL) -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; \
+ $(INSTALL) -d $(DESTDIR)$(MANDIR)/$$lang/man1/; \
+ $(INSTALL) -m644 docs/ldid.$$lang.1 $(DESTDIR)$(MANDIR)/$$lang/man1/ldid.1; \
done
clean: