From e91ec0d87aa31cb465fe8cf934d405ad56342eba Mon Sep 17 00:00:00 2001
From: Nick White <git@njw.me.uk>
Date: Wed, 19 May 2010 17:15:41 +0100
Subject: Switched to simpler build system, and fixed bugs

Now there's a proper build system in place, which is actually simple
enough to understand.
I also fixed plenty of warnings about the code (reminding me how badly I
knew C when I wrote this).
Hinduism today aren't indexing their new issues using the index file I
was sourcing any more, so I don't expect to fix any more bugs or improve
this much.
---
 Makefile | 40 ++++++++++++++++++++++++++++++++++++++++
 1 file changed, 40 insertions(+)
 create mode 100644 Makefile

(limited to 'Makefile')

diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..9a9847c
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,40 @@
+# See COPYING file for copyright, license and warranty details.
+
+include config.mk
+
+TARGET = getht
+SRC = $(shell find . -name '*.c')
+OBJ = $(SRC:.c=.o)
+MAN = $(TARGET:=.1)
+DOC = README
+
+all: $(TARGET)
+
+$(TARGET:=.o): $(SRC)
+	cc -c $(SRC) $(CFLAGS)
+
+$(TARGET): $(OBJ)
+	cc -o $@ $(OBJ) $(LDFLAGS)
+
+clean:
+	rm -f -- $(TARGET) $(OBJ)
+
+install:
+	mkdir -p $(DESTDIR)$(PREFIX)/bin
+	cp -f $(TARGET) $(DESTDIR)$(PREFIX)/bin
+	mkdir -p $(DESTDIR)$(MANPREFIX)/man1
+	cp -f $(MAN) $(DESTDIR)$(MANPREFIX)/man1
+
+uninstall:
+	rm -f $(DESTDIR)$(PREFIX)/bin/$(TARGET)
+	rm -f $(DESTDIR)$(MANPREFIX)/man1/$(MAN)
+
+dist: clean
+	mkdir -p getht-$(VERSION)
+	cp -R $(SRC) $(DOC) getht-$(VERSION)
+	sed "s/VERSION/$(VERSION)/g" < $(MAN) > getht-$(VERSION)/$(MAN)
+	tar -c getht-$(VERSION) > getht-$(VERSION).tar
+	bzip2 < getht-$(VERSION).tar > getht-$(VERSION).tar.bz2
+	rm -rf getht-$(VERSION).tar getht-$(VERSION)
+	gpg -b < getht-$(VERSION).tar.bz2 > getht-$(VERSION).tar.bz2.sig
+	sha1sum < getht-$(VERSION).tar.bz2 > getht-$(VERSION).tar.bz2.sha1
-- 
cgit v1.2.3