summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorJens Axboe <axboe@kernel.dk>2019-01-15 11:14:43 -0700
committerJens Axboe <axboe@kernel.dk>2019-01-15 11:19:16 -0700
commitf16b83b29349dae16f07aae9a1709aed0dff247d (patch)
tree6bdeb2fd6d7a7572ec974638acfd5d4f387aaba5 /Makefile
parent89167b457f5678fd8fae0696d616cef5e3a3c379 (diff)
Add configure script
Some older installs don't have __kernel_rwf_t in linux/fs.h, so add a check for that. Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile14
1 files changed, 14 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index 0fbd83c..547137d 100644
--- a/Makefile
+++ b/Makefile
@@ -14,10 +14,24 @@ all:
@$(MAKE) -C src
@$(MAKE) -C test
+config-host.mak: configure
+ @if [ ! -e "$@" ]; then \
+ echo "Running configure ..."; \
+ ./configure; \
+ else \
+ echo "$@ is out-of-date, running configure"; \
+ sed -n "/.*Configured with/s/[^:]*: //p" "$@" | sh; \
+ fi
+
+ifneq ($(MAKECMDGOALS),clean)
+include config-host.mak
+endif
+
install:
@$(MAKE) -C src install prefix=$(DESTDIR)$(prefix) includedir=$(DESTDIR)$(includedir) libdir=$(DESTDIR)$(libdir)
clean:
+ @rm -f config-host.mak config-host.h
@$(MAKE) -C src clean
@$(MAKE) -C test clean