Blob


1 include version.mk
3 BIN = rene
4 OBJ = $(BIN:=.o)
5 SRC = $(BIN:=.c)
6 MAN = $(BIN:=.1)
8 PREFIX ?= $(DESTDIR)/usr/local
9 MANPREFIX ?= $(PREFIX)/man
11 bindir = $(PREFIX)/bin
12 mandir = $(MANPREFIX)/man1
14 all: $(BIN)
16 .SUFFIXES: .o .c
18 $(BIN): $(OBJ)
19 $(CC) -o $@ $(OBJ) $(LDFLAGS)
21 .c.o:
22 $(CC) -std=c99 -pedantic $(CFLAGS) $(CPPFLAGS) -c $<
24 install: all
25 mkdir -p $(bindir)
26 install -m 755 $(BIN) $(bindir)
27 mkdir -p $(mandir)
28 install -m 644 $(MAN) $(mandir)
30 uninstall:
31 cd $(bindir) && rm -f $(BIN)
32 cd $(mandir) && rm -f $(MAN)
34 dist: clean
35 mkdir -p rene-$(V)
36 cp -rf CHANGES README COPYING Makefile version.mk t $(SRC) $(MAN) \
37 rene-$(V)
38 tar cf - rene-$(V) | gzip >rene-$(V).tar.gz
39 rm -rf rene-$(V)
41 clean:
42 -rm -rf $(BIN) $(OBJ) rene-$(V) *.tar.gz *.core t/*.out t/*.err
44 test: all
45 sh ./t/t.sh
47 tags:
48 ctags $(SRC)
50 .PHONY: all install uninstall clean dist test