about summary refs log tree commit diff
path: root/Makefile
diff options
context:
space:
mode:
authorLeah Neukirchen <leah@vuxu.org>2017-10-19 15:15:04 +0200
committerLeah Neukirchen <leah@vuxu.org>2017-10-19 15:15:04 +0200
commit466dd62ba30b8270379a79238bc85e21a75ebcbe (patch)
tree312c59892368d64a8b91790a2a3c1dea4bcc688e /Makefile
downloadnecho-466dd62ba30b8270379a79238bc85e21a75ebcbe.tar.gz
necho-466dd62ba30b8270379a79238bc85e21a75ebcbe.tar.xz
necho-466dd62ba30b8270379a79238bc85e21a75ebcbe.zip
initial import of necho
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile36
1 files changed, 36 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..6d4328b
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,36 @@
+CFLAGS=-g -O2 -Wall -Wno-switch -Wextra
+
+DESTDIR=
+PREFIX=/usr/local
+BINDIR=$(PREFIX)/bin
+MANDIR=$(PREFIX)/share/man
+
+ALL = necho
+LINKS = zecho qecho jecho secho
+
+all: $(ALL) $(LINKS) $(LINKS:=.1)
+
+README: necho.1
+	mandoc -Tutf8 $< | col -bx >$@
+
+necho: necho.c
+
+$(LINKS): necho
+	ln -sf $< $@
+
+$(LINKS:=.1): necho.1
+	ln -sf $< $@
+
+install: FRC all
+	mkdir -p $(DESTDIR)$(BINDIR) $(DESTDIR)$(MANDIR)/man1
+	install -m0755 $(ALL) $(DESTDIR)$(BINDIR)
+	install -m0644 $(ALL:=.1) $(DESTDIR)$(MANDIR)/man1
+	for l in $(LINKS); do \
+		ln -sf necho $(DESTDIR)$(BINDIR)/$$l; \
+		ln -sf necho.1 $(DESTDIR)$(MANDIR)/man1/$$l.1; \
+	done
+
+clean: FRC
+	rm -f $(ALL) $(LINKS) $(LINKS:=.1)
+
+FRC: