Blob


1 include version.mk
3 BIN = gpass
4 OBJ = $(BIN:=.o)
5 SRC = $(BIN:=.c)
6 MAN = $(BIN:=.1)
7 M4S = $(BIN:=.m4)
9 PREFIX ?= $(DESTDIR)/usr/local
10 MANPREFIX ?= $(PREFIX)/man
12 M4 ?= m4
14 LIBS = -lm
16 bindir = $(PREFIX)/bin
17 mandir = $(MANPREFIX)/man1
18 sharedir = $(PREFIX)/share
19 gpassdir = $(sharedir)/gpass
21 all: $(BIN) $(MAN)
23 .SUFFIXES: .c .o .1 .m4
25 $(BIN): $(OBJ)
26 $(CC) -o $@ $(OBJ) $(LIBS) $(LDFLAGS)
28 .c.o:
29 $(CC) -std=c99 -pedantic -DPREFIX=\"$(PREFIX)\" $(CFLAGS) $(CPPFLAGS) -c $<
31 $(MAN): $(M4S)
33 .m4.1:
34 $(M4) -DPREFIX=$(PREFIX) <$< >$@
36 install: all
37 mkdir -p $(bindir)
38 install -m 755 $(BIN) $(bindir)
39 mkdir -p $(mandir)
40 install -m 644 $(MAN) $(mandir)
41 mkdir -p $(gpassdir)
42 install -m 644 eff.long $(gpassdir)
44 uninstall:
45 cd $(bindir) && rm -f $(BIN)
46 cd $(mandir) && rm -f $(MAN)
47 rm -rf $(gpassdir)
49 clean:
50 -rm -f $(BIN) $(OBJ) $(MAN) *.tar.gz *.core gpass-$(V)
52 dist: clean
53 mkdir -p gpass-$(V)
54 cp -f CHANGES COPYING README Makefile version.mk eff.long $(SRC) $(M4S) \
55 gpass-$(V)
56 tar cf - gpass-$(V) | gzip >gpass-$(V).tar.gz
57 rm -rf gpass-$(V)
59 tags:
60 ctags $(SRC)
62 .PHONY: all options install uninstall clean dist