From 45b62beddc014daf0ad5da0320155598b641a7ea Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Thu, 16 Sep 2021 18:32:09 +0200 Subject: Improve makefile + m whitespace fix MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- Makefile | 8 +++----- config.mk | 6 ++++-- mongotimer.c | 1 + 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index c27a730..08f6890 100644 --- a/Makefile +++ b/Makefile @@ -8,13 +8,14 @@ DIGITS =\ mongo_5.h mongo_6.h mongo_7.h mongo_8.h mongo_9.h \ mongo_c.h mongo_m.h + all: mongotimer mongotimer: mongotimer.o $(CC) -o $@ mongotimer.o $(LDFLAGS) mongotimer.o: mongotimer.c arg.h $(DIGITS) - $(CC) -c -o $@ mongotimer.c $(CPPFLAGS) $(CFLAGS) + $(CC) -c -o $@ mongotimer.c $(CFLAGS) $(CPPFLAGS) mongo_0.h: digit.sh ./digit.sh 0 > $@ @@ -54,18 +55,15 @@ mongo_m.h: digit.sh install: mongotimer mkdir -p -- "$(DESTDIR)$(PREFIX)/bin" - mkdir -p -- "$(DESTDIR)$(PREFIX)/share/licenses/mongotimer" mkdir -p -- "$(DESTDIR)$(MANPREFIX)/man1" cp -- mongotimer "$(DESTDIR)$(PREFIX)/bin/" - cp -- LICENSE "$(DESTDIR)$(PREFIX)/share/licenses/mongotimer/" cp -- mongotimer.1 "$(DESTDIR)$(MANPREFIX)/man1/" uninstall: -rm -- "$(DESTDIR)$(PREFIX)/bin/mongotimer" -rm -- "$(DESTDIR)$(MANPREFIX)/man1/mongotimer.1" - -rm -r -- "$(DESTDIR)$(PREFIX)/share/licenses/mongotimer" clean: - -rm -f -- *.o mongotimer mongo_*.h + -rm -f -- *.o *.su mongotimer mongo_*.h .PHONY: all install uninstall clean diff --git a/config.mk b/config.mk index a2b8a0f..f262b1e 100644 --- a/config.mk +++ b/config.mk @@ -1,6 +1,8 @@ -PREFIX = /usr/local +PREFIX = /usr MANPREFIX = $(PREFIX)/share/man -CFLAGS = -std=c99 -Wall -Wextra -O2 +CC = cc + CPPFLAGS = -D_DEFAULT_SOURCE -D_BSD_SOURCE -D_XOPEN_SOURCE=700 -D_GNU_SOURCE +CFLAGS = -std=c99 -Wall -O2 LDFLAGS = -s diff --git a/mongotimer.c b/mongotimer.c index 5bf9e0f..7fe6e05 100644 --- a/mongotimer.c +++ b/mongotimer.c @@ -32,6 +32,7 @@ #include "mongo_c.h" #include "mongo_m.h" + static const char **mongo_ds[] = { mongo_0, mongo_1, mongo_2, mongo_3, mongo_4, mongo_5, mongo_6, mongo_7, mongo_8, mongo_9 -- cgit v1.2.3-70-g09d2