-.PHONY: build install
+TARGETS := logcat dpkg-history
+
+.PHONY: all install
PREFIX = /usr/local
INSTALLDIR = $(PREFIX)/bin
-ECHO = echo
INSTALL = install
-build:
- @$(ECHO) "nothing is needed to build."
-install: logcat dpkg-history
- $(INSTALL) -m 755 logcat $(INSTALLDIR)
- $(INSTALL) -m 755 dpkg-history $(INSTALLDIR)
+all: $(TARGET)
+
+install: $(TARGETS)
+ for f in $(TARGETS); do $(INSTALL) -m 755 $$f $(INSTALLDIR); done
-clean:
- @$(ECHO) "nothing is needed to clean."
+distclean:
+ $(RM) $(TARGETS)
# logcat
# 指定したログを、logrotateした分も含めてすべて出力
#
-gunzip $1.[0-9]* | cat - $1.[0-9]* $1 | sort
+gunzip -c $1.[0-9]* | cat - $1.[0-9]* $1 | sort