2019-01-08 06:51:07 -07:00
|
|
|
NAME=liburing
|
|
|
|
|
SPECFILE=$(NAME).spec
|
|
|
|
|
VERSION=$(shell awk '/Version:/ { print $$2 }' $(SPECFILE))
|
|
|
|
|
TAG = $(NAME)-$(VERSION)
|
|
|
|
|
RPMBUILD=$(shell `which rpmbuild >&/dev/null` && echo "rpmbuild" || echo "rpm")
|
|
|
|
|
|
|
|
|
|
prefix=/usr
|
|
|
|
|
includedir=$(prefix)/include
|
|
|
|
|
libdir=$(prefix)/lib
|
|
|
|
|
|
|
|
|
|
default: all
|
|
|
|
|
|
|
|
|
|
all:
|
|
|
|
|
@$(MAKE) -C src
|
2019-01-08 15:48:57 -07:00
|
|
|
@$(MAKE) -C test
|
2019-04-17 17:38:14 +00:00
|
|
|
@$(MAKE) -C examples
|
|
|
|
|
|
|
|
|
|
runtests:
|
|
|
|
|
@$(MAKE) -C test runtests
|
2019-01-08 06:51:07 -07:00
|
|
|
|
2019-01-15 11:14:43 -07:00
|
|
|
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
|
|
|
|
|
|
2019-01-08 06:51:07 -07:00
|
|
|
install:
|
|
|
|
|
@$(MAKE) -C src install prefix=$(DESTDIR)$(prefix) includedir=$(DESTDIR)$(includedir) libdir=$(DESTDIR)$(libdir)
|
|
|
|
|
|
|
|
|
|
clean:
|
2019-03-05 16:19:59 -07:00
|
|
|
@rm -f config-host.mak config-host.h cscope.out
|
2019-01-08 06:51:07 -07:00
|
|
|
@$(MAKE) -C src clean
|
2019-01-08 15:48:57 -07:00
|
|
|
@$(MAKE) -C test clean
|
2019-01-08 06:51:07 -07:00
|
|
|
|
2019-03-05 16:19:59 -07:00
|
|
|
cscope:
|
|
|
|
|
@cscope -b -R
|
|
|
|
|
|
2019-01-08 06:51:07 -07:00
|
|
|
tag-archive:
|
|
|
|
|
@git tag $(TAG)
|
|
|
|
|
|
|
|
|
|
create-archive:
|
|
|
|
|
@git archive --prefix=$(NAME)-$(VERSION)/ -o $(NAME)-$(VERSION).tar.gz $(TAG)
|
|
|
|
|
@echo "The final archive is ./$(NAME)-$(VERSION).tar.gz."
|
|
|
|
|
|
|
|
|
|
archive: clean tag-archive create-archive
|
|
|
|
|
|
|
|
|
|
srpm: create-archive
|
|
|
|
|
$(RPMBUILD) --define "_sourcedir `pwd`" --define "_srcrpmdir `pwd`" --nodeps -bs $(SPECFILE)
|