Commit Diff


commit - c27ffe568dc2c4062af04297ddd33289124bcce6
commit + 0bef3bb5486fcefceddd8ad884fdb7b3ab9fb65d
blob - 508ca23dda54059ab56f313208d7c6f2dc6cc3d8
blob + 3656c589688f14511ba331055435fe312e1aa917
--- Makefile
+++ Makefile
@@ -1,49 +1,52 @@
-include config.mk
+include version.mk
 
-.SUFFIXES: .o .c
-
 BIN = gpass
 OBJ = $(BIN:=.o)
 SRC = $(BIN:=.c)
 MAN = $(BIN:=.1)
 
-all: options $(BIN)
+PREFIX ?= $(DESTDIR)/usr/local
+MANPREFIX ?= $(PREFIX)/man
 
-options:
-	@echo gpass build options:
-	@echo "	CFLAGS = $(CFLAGS)"
-	@echo "	LDFLAGS = $(LDFLAGS)"
-	@echo "	CC = $(CC)"
+LIBS = -lm
 
-$(BIN): $(OBJ)
-	$(CC) -o $@ $(OBJ) $(LDFLAGS)
+bindir = $(PREFIX)/bin
+man1dir = $(MANPREFIX)/man1
+sharedir = $(PREFIX)/share
+gpassdir = $(sharedir)/gpass
 
-$(OBJ): config.mk
+all: $(BIN)
 
+$(BIN): $(OBJ)
+	$(CC) -o $@ $(OBJ) $(LIBS) $(LDFLAGS)
+
 .c.o:
-	$(CC) -DPREFIX=\"$(PREFIX)\" $(CFLAGS) $(CPPFLAGS) -c $<
+	$(CC) -std=c99 -pedantic -DPREFIX=\"$(PREFIX)\" $(CFLAGS) $(CPPFLAGS) -c $<
 
 install: all
-	mkdir -p $(DESTDIR)$(PREFIX)/bin
-	install -m 755 $(BIN) $(DESTDIR)$(PREFIX)/bin/
-	mkdir -p $(DESTDIR)$(MANPREFIX)/man1
-	sed s=PREFIX=$(PREFIX)=g <gpass.1 >$(DESTDIR)$(MANPREFIX)/man1/gpass.1
-	chmod 644 $(DESTDIR)$(MANPREFIX)/man1/gpass.1
-	mkdir -p $(DESTDIR)$(PREFIX)/share/gpass
-	install -m 644 eff.long $(DESTDIR)$(PREFIX)/share/gpass
+	mkdir -p $(bindir)
+	install -m 755 $(BIN) $(bindir)
+	mkdir -p $(man1dir)
+	sed s=PREFIX=$(PREFIX)=g <gpass.1 >$(man1dir)/gpass.1
+	cd $(man1dir) && chmod 644 $(MAN)
+	mkdir -p $(gpassdir)
+	install -m 644 eff.long $(gpassdir)
 
 uninstall:
-	cd $(DESTDIR)$(PREFIX)/bin && rm -f $(BIN)
-	cd $(DESTDIR)$(MANPREFIX)/man1 && rm -f $(MAN)
-	cd $(DESTDIR)$(PREFIX)/share && rm -rf gpass
+	cd $(bindir) && rm -f $(BIN)
+	cd $(man1dir) && rm -f $(MAN)
+	rm -rf $(gpassdir)
 
 clean:
-	-rm -f $(BIN) $(OBJ) *.tar.gz *.core
+	-rm -f $(BIN) $(OBJ) *.tar.gz *.core gpass-$(V)
 
 dist: clean
-	mkdir -p gpass-$(VERSION)
-	cp -f CHANGES README Makefile config.mk eff.long $(SRC) $(MAN) gpass-$(VERSION)
-	tar cf - gpass-$(VERSION) | gzip >gpass-$(VERSION).tar.gz
-	rm -rf gpass-$(VERSION)
+	mkdir -p gpass-$(V)
+	cp -f CHANGES README Makefile version.mk eff.long $(SRC) $(MAN) gpass-$(V)
+	tar cf - gpass-$(VERSION) | gzip >gpass-$(V).tar.gz
+	rm -rf gpass-$(V)
 
+tags:
+	ctags $(SRC)
+
 .PHONY: all options install uninstall clean dist
blob - 3bbb4ba537c409a438631d25d52cb2c8ba528e9a
blob + 1654207ba921d4752f2df44c39fa16b6e0d5e444
--- README
+++ README
@@ -1,7 +1,6 @@
-gpass is a utility to generate secure passphrases. To install simply edit
-config.mk as necessary and run `make', followed by `make install':
+gpass is a utility to generate secure passphrases. To install run `make',
+followed by `make install':
 
-	$ $EDITOR config.mk
 	$ make
 	# make install
 
blob - 970b8d8786817793d5ea13282e8d836680ed2941 (mode 644)
blob + /dev/null
--- config.mk
+++ /dev/null
@@ -1,15 +0,0 @@
-VERSION = 0.4
-
-PREFIX = /usr/local
-MANPREFIX = $(PREFIX)/man
-
-CC = cc
-CPPFLAGS = -D_DEFAULT_SOURCE
-CFLAGS = -std=c99 -Wall -pedantic -O2
-LDFLAGS = -lm
-
-# Linux
-#MANPREFIX = $(PREFIX)/share/man
-
-# Debug
-#CFLAGS = -std=c99 -Wall -pedantic -Wextra -O0 -g
blob - /dev/null
blob + c860f959a3ddce048217698c31bff9750d0907b5 (mode 644)
--- /dev/null
+++ version.mk
@@ -0,0 +1 @@
+V = 0.4