Commit 001bfef7 authored by Dom Sekotill's avatar Dom Sekotill
Browse files

Adjusted the Makefile layout and added sections

Sorted the Makefile recipes into conceptually related sections like "Install"
and "Uninstall", and added some useful do-nothing recipes; "all" and "clean".
parent 0b35e9f6
Loading
Loading
Loading
Loading
+22 −7
Original line number Diff line number Diff line
@@ -27,23 +27,38 @@ LIBS = run-hooks string_functions arg_parse_functions
cp = cp --preserve=mode,timestamps
rm = rm --interactive=never

.PHONY: install install-bin install-lib
.PHONY: uninstall uninstall-bin uninstall-lib
.PHONY: clean

# Default action
.PHONY: all
all:
	# Nothing to build. Did you mean 'make install'?


# Install
.PHONY: install install-bin install-lib
install: install-bin install-lib
uninstall: uninstall-bin uninstall-lib

install-bin: $(BINS)
	$(cp) $? "$(BINDIR)"

uninstall-bin:
	cd "$(BINDIR)"; $(rm) $(BINS)

install-lib: $(LIBS)
	@mkdir -p "$(LIBDIR)/$(PACKAGE)"
	$(cp) $? "$(LIBDIR)/$(PACKAGE)"
	sed -i 's|LIBDIR=.*|LIBDIR=$(LIBDIR)/$(PACKAGE)|' $(addprefix "$(BINDIR)"/, $(BINS))


# Uninstall
.PHONY: uninstall uninstall-bin uninstall-lib
uninstall: uninstall-bin uninstall-lib

uninstall-bin:
	cd "$(BINDIR)"; $(rm) $(BINS)

uninstall-lib:
	$(rm) -r "$(LIBDIR)/$(PACKAGE)"


# Clean up
.PHONY: clean
clean:
	# nothing to do