aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2021-09-16 16:15:47 +0200
committerMattias Andrée <maandree@kth.se>2021-09-16 16:15:47 +0200
commit1590e7b0dc7e9848e060b7228a27d5309334d712 (patch)
tree00dde57f0be3755531abedec86dba2c47a923a01
parentChange license, rewrite in C, remove info manual, remove shell tab completion, misc (diff)
downloadbfind-3.0.1.tar.gz
bfind-3.0.1.tar.bz2
bfind-3.0.1.tar.xz
Improve makefile and silence false warning3.0.1
Signed-off-by: Mattias Andrée <maandree@kth.se>
-rw-r--r--Makefile4
-rw-r--r--bfind.c2
-rw-r--r--config.mk4
3 files changed, 6 insertions, 4 deletions
diff --git a/Makefile b/Makefile
index 0fc98f5..f756909 100644
--- a/Makefile
+++ b/Makefile
@@ -7,7 +7,7 @@ include $(CONFIGFILE)
all: bfind
bfind.o: bfind.c arg.h
- $(CC) -c -o $@ bfind.c $(CPPFLAGS) $(CFLAGS)
+ $(CC) -c -o $@ bfind.c $(CFLAGS) $(CPPFLAGS)
bfind: bfind.o
$(CC) -o $@ bfind.o $(LDFLAGS)
@@ -23,6 +23,6 @@ uninstall:
-rm -f -- "$(DESTDIR)$(MANPREFIX)/man1/bfind.1"
clean:
- -rm -rf -- bfind *.o
+ -rm -rf -- bfind *.o *.su
.PHONY: all install uninstall clean
diff --git a/bfind.c b/bfind.c
index 323ee73..7ca2001 100644
--- a/bfind.c
+++ b/bfind.c
@@ -217,7 +217,7 @@ main(int argc, char *argv[])
{
char ending = '\n', *path;
struct stat st;
- dev_t start_dev;
+ dev_t start_dev = 0; /* compiler incorrectly thinks its may be uninitialised if not assigned */
size_t i;
ARGBEGIN {
diff --git a/config.mk b/config.mk
index 7c93a9a..2176f52 100644
--- a/config.mk
+++ b/config.mk
@@ -1,6 +1,8 @@
PREFIX = /usr
MANPREFIX = $(PREFIX)/share/man
+CC = cc
+
CPPFLAGS = -D_DEFAULT_SOURCE -D_BSD_SOURCE -D_XOPEN_SOURCE=700 -D_GNU_SOURCE
-CFLAGS = -std=c99 -Wall
+CFLAGS = -std=c99 -Wall -O2
LDFLAGS =