gs

painless gist creator
git clone git://edryd.org/gs
Log | Files | Refs | LICENSE

commit 07d509cd734c42739aa07ce8653b6220c064f561
parent f4e483ff225f593b09458eedee302828e64a58b5
Author: Ed van Bruggen <edvb@uw.edu>
Date:   Sat, 28 Mar 2020 13:41:20 -0700

Clean up Makefile, use cc only if not set before

Diffstat:
Makefile | 20+++++++-------------
config.mk | 6+++---
2 files changed, 10 insertions(+), 16 deletions(-)

diff --git a/Makefile b/Makefile @@ -4,7 +4,7 @@ include config.mk EXE = gs -SRC = $(wildcard *.c) $(wildcard */*.c) +SRC = gs.c util.c extern/frozen.c OBJ = $(SRC:.c=.o) all: options $(EXE) @@ -33,32 +33,27 @@ $(EXE): $(OBJ) @$(CC) -o $@ $(OBJ) $(LDFLAGS) clean: - @echo -n cleaning ... + @echo cleaning @rm -f $(OBJ) $(EXE) - @echo \ done install: all - @echo -n installing $(EXE) to $(DESTDIR)$(PREFIX)/bin ... + @echo installing $(EXE) to $(DESTDIR)$(PREFIX)/bin @mkdir -p $(DESTDIR)$(PREFIX)/bin @cp -f $(EXE) $(DESTDIR)$(PREFIX)/bin @chmod 755 $(DESTDIR)$(PREFIX)/bin/$(EXE) - @echo \ done - @echo -n installing manual page to $(DESTDIR)$(MANPREFIX)/man1 ... + @echo installing manual page to $(DESTDIR)$(MANPREFIX)/man1 @mkdir -p $(DESTDIR)$(MANPREFIX)/man1 @sed "s/VERSION/$(VERSION)/g" < $(EXE).1 > $(DESTDIR)$(MANPREFIX)/man1/$(EXE).1 @chmod 644 $(DESTDIR)$(MANPREFIX)/man1/$(EXE).1 - @echo \ done uninstall: - @echo -n removing $(EXE) from $(DESTDIR)$(PREFIX)/bin ... + @echo removing $(EXE) from $(DESTDIR)$(PREFIX)/bin @rm -f $(DESTDIR)$(PREFIX)/bin/$(EXE) - @echo \ done - @echo -n removing manual page from $(DESTDIR)$(MANPREFIX)/man1 ... + @echo -n removing manual page from $(DESTDIR)$(MANPREFIX)/man1 @rm -f $(DESTDIR)$(MANPREFIX)/man1/$(EXE).1 - @echo \ done man: - @echo -n updating man page $(EXE).1 ... + @echo updating man page $(EXE).1 @(head -1 README.md | sed "s/$(EXE)/$(EXE) 1 \"`date +%B\ %Y`\" \"$(EXE)\ $(VERSION)\"\n\n##NAME\n\n&/"; \ echo "\n##SYNOPSIS\n"; \ ./$(EXE) -h 2>&1 | sed -E 's/(\<[_A-Z][_A-Z]+\>)/\*\1\*/g' | \ @@ -68,6 +63,5 @@ man: echo "\n##DESCRIPTION"; \ tail +2 README.md;) | \ md2roff - | sed "9s/]/]\ /g" | sed "9s/|/|\ /g" > $(EXE).1 - @echo \ done .PHONY: all options clean install uninstall man diff --git a/config.mk b/config.mk @@ -11,8 +11,8 @@ LIBS = -lcurl # flags CPPFLAGS = -DVERSION=\"$(VERSION)\" -D_DEFAULT_SOURCE -D_BSD_SOURCE -D_XOPEN_SOURCE=600 -CFLAGS = -g -std=c99 -pedantic -Wall $(INCS) $(CPPFLAGS) -LDFLAGS = -g $(LIBS) +CFLAGS = -std=c99 -pedantic -Wall $(INCS) $(CPPFLAGS) +LDFLAGS = $(LIBS) # compiler and linker -CC = gcc +CC ?= cc