~adnano/astronaut

533bcab2643cdaec83c78ab1d501b56ed0571f0d — Adnan Maolood 1 year, 2 months ago 58ca330
Makefile: Use phony target

Use a phony target to build the binary, which allows us to drop the
configure script.
4 files changed, 7 insertions(+), 32 deletions(-)

M .gitignore
M Makefile
M README.md
D configure
M .gitignore => .gitignore +0 -1
@@ 1,3 1,2 @@
astronaut
*.1
config.mk

M Makefile => Makefile +7 -10
@@ 1,9 1,6 @@
.POSIX:

PREFIX=/usr/local

include config.mk

BINDIR=$(PREFIX)/bin
SHAREDIR=$(PREFIX)/share/astronaut
MANDIR=$(PREFIX)/share/man


@@ 17,21 14,21 @@ DOCS = \

all: astronaut doc

astronaut:
	$(GO) build $(GOFLAGS) \
		-ldflags "-X main.ShareDir=$(SHAREDIR)" \
		-o $@

doc: $(DOCS)

astronaut.1: doc/astronaut.1.scd
	scdoc < doc/astronaut.1.scd > $@

astronaut: $(GOSRC)
	$(GO) build $(GOFLAGS) \
		-ldflags "-X main.ShareDir=$(SHAREDIR)" \
		-o $@

clean:
	$(RM) astronaut
	$(RM) $(DOCS)

install: all
install:
	mkdir -m755 -p $(DESTDIR)$(BINDIR) $(DESTDIR)$(SHAREDIR) $(DESTDIR)$(MANDIR)/man1
	install -m755 astronaut $(DESTDIR)$(BINDIR)/astronaut
	install -m644 astronaut.1 $(DESTDIR)$(MANDIR)/man1/astronaut.1


@@ 44,4 41,4 @@ uninstall:
	$(RM) $(DESTDIR)$(SHAREDIR)/astronaut.conf
	$(RM) $(DESTDIR)$(SHAREDIR)/style.conf

.PHONY: all doc clean install uninstall
.PHONY: all astronaut doc clean install uninstall

M README.md => README.md +0 -1
@@ 13,7 13,6 @@ First install the dependencies:

Then compile:

	$ ./configure
	$ make
	# make install


D configure => configure +0 -20
@@ 1,20 0,0 @@
#!/bin/sh -e

RELEASE=0.1.0
gosrc="$(find . -name '*.go' -print)"

exec > config.mk

for opt; do
    case "$opt" in
        (--prefix=*) printf "PREFIX = %s\n" "${opt#*=}" ;;
        (*) printf "warning: unknown option %s\n" "$opt" >&2 ;;
    esac
done

printf "GOSRC = "

# word splitting is desired
# shellcheck disable=2086
printf "%s " $gosrc go.mod go.sum about/*
printf "\n"