commit 36ebe73a90c17c577a99080db649cac990f8965f from: Alexander Arkhipov date: Tue May 30 16:58:17 2023 UTC remove config.mk in favour of variables commit - 2d0f69ef04f39821ece09c209f98b5d2735e3b6a commit + 36ebe73a90c17c577a99080db649cac990f8965f blob - e12159414ad54aaf01b881b27f0f3e44631f6cc2 blob + 889819321720d16117a84593eff62759ee03f1f6 --- Makefile +++ Makefile @@ -1,42 +1,50 @@ -include config.mk +include version.mk -.SUFFIXES: .o .c - BIN = rene OBJ = $(BIN:=.o) SRC = $(BIN:=.c) MAN = $(BIN:=.1) +PREFIX ?= $(DESTDIR)/usr/local +MANPREFIX ?= $(PREFIX)/man + +bindir = $(PREFIX)/bin +mandir = $(MANPREFIX)/man1 + all: $(BIN) +.SUFFIXES: .o .c + $(BIN): $(OBJ) $(CC) -o $@ $(OBJ) $(LDFLAGS) -$(OBJ): config.mk - .c.o: - $(CC) $(CFLAGS) $(CPPFLAGS) -c $< + $(CC) -std=c99 -pedantic $(CFLAGS) $(CPPFLAGS) -c $< install: all - mkdir -p $(DESTDIR)$(PREFIX)/bin - install -m 755 $(BIN) $(DISTDIR)$(PREFIX)/bin/ - mkdir -p $(DESTDIR)$(MANPREFIX)/man1 - install -m 644 $(MAN) $(DISTDIR)$(MANPREFIX)/man1 + mkdir -p $(bindir) + install -m 755 $(BIN) $(bindir) + mkdir -p $(mandir) + install -m 644 $(MAN) $(mandir) uninstall: - cd $(DESTDIR)$(PREFIX)/bin && rm -f $(BIN) - cd $(DESTDIR)$(MANPREFIX)/man1 && rm -f $(MAN) + cd $(bindir) && rm -f $(BIN) + cd $(mandir) && rm -f $(MAN) dist: clean - mkdir -p rene-$(VERSION) - cp -rf CHANGES README Makefile config.mk t $(SRC) $(MAN) rene-$(VERSION) - tar cf - rene-$(VERSION) | gzip >rene-$(VERSION).tar.gz - rm -rf rene-$(VERSION) + mkdir -p rene-$(V) + cp -rf CHANGES README COPYING Makefile version.mk t $(SRC) $(MAN) \ + rene-$(V) + tar cf - rene-$(V) | gzip >rene-$(V).tar.gz + rm -rf rene-$(V) clean: - -rm -f $(BIN) $(OBJ) *.tar.gz *.core t/*.out t/*.err + -rm -rf $(BIN) $(OBJ) rene-$(V) *.tar.gz *.core t/*.out t/*.err test: all sh ./t/t.sh +tags: + ctags $(SRC) + .PHONY: all install uninstall clean dist test blob - 3fe25c1d84e42138b22a3d10c5589b8b910439b0 (mode 644) blob + /dev/null --- config.mk +++ /dev/null @@ -1,13 +0,0 @@ -VERSION = 0.2.4 - -PREFIX = /usr/local -MANPREFIX = $(PREFIX)/man -# Linux -#MANPREFIX = $(PREFIX)/share/man - -CC = cc -CFLAGS = -std=c99 -Wall -pedantic -CPPFLAGS = -D_DEFAULT_SOURCE - -# Debug -#CFLAGS = -std=c99 -Wall -pedantic -Wextra -O0 -g blob - /dev/null blob + 04b83cf6353287750e9a92dbafede15acace4675 (mode 644) --- /dev/null +++ version.mk @@ -0,0 +1 @@ +V = 0.2.4