add 'uninstall' make target

[skip ci]
This commit is contained in:
Steffen Jaeckel 2017-07-10 10:16:35 +02:00
parent 3806629e9e
commit 221f7f223d
3 changed files with 16 additions and 0 deletions

View File

@ -26,6 +26,7 @@ ifndef RANLIB
RANLIB:=$(CROSS_COMPILE)ranlib
endif
INSTALL_CMD = install
UNINSTALL_CMD = rm
#Output filenames for various targets.
ifndef LIBNAME
@ -93,6 +94,8 @@ install: .common_install
install_bins: .common_install_bins
uninstall: .common_uninstall
profile:
CFLAGS="$(CFLAGS) -fprofile-generate" $(MAKE) timing EXTRALIBS="$(EXTRALIBS) -lgcov"
./timing

View File

@ -25,6 +25,7 @@ ifndef LT
endif
LTCOMPILE = $(LT) --mode=compile --tag=CC $(CC)
INSTALL_CMD = $(LT) --mode=install install
UNINSTALL_CMD = $(LT) --mode=uninstall rm
#Output filenames for various targets.
ifndef LIBNAME
@ -52,6 +53,9 @@ install: .common_install
install_bins: .common_install_bins
uninstall: .common_uninstall
rm $(DESTDIR)$(LIBPATH)/pkgconfig/libtomcrypt.pc
test: $(LIBNAME) $(TOBJECTS)
$(LT) --mode=link --tag=CC $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o $(TEST) $(TOBJECTS) $(LIBNAME) $(EXTRALIBS)

View File

@ -30,6 +30,9 @@ endif
ifndef INSTALL_CMD
$(error your makefile must define INSTALL_CMD)
endif
ifndef UNINSTALL_CMD
$(error your makefile must define UNINSTALL_CMD)
endif
ifndef EXTRALIBS
ifneq ($(shell echo $(CFLAGS) | grep USE_LTM),)
@ -383,6 +386,12 @@ install_docs: doc/crypt.pdf
install_hooks:
for s in `ls hooks/`; do ln -s ../../hooks/$$s .git/hooks/$$s; done
HEADER_FILES=$(notdir $(HEADERS))
.common_uninstall:
$(UNINSTALL_CMD) $(LIBPATH)/$(LIBNAME)
rm $(HEADER_FILES:%=$(INCPATH)/%)
#This rule cleans the source tree of all compiled code, not including the pdf
#documentation.
clean: