Skip to content

Commit 221f7f2

Browse files
committed
add 'uninstall' make target
[skip ci]
1 parent 3806629 commit 221f7f2

3 files changed

Lines changed: 16 additions & 0 deletions

File tree

makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ ifndef RANLIB
2626
RANLIB:=$(CROSS_COMPILE)ranlib
2727
endif
2828
INSTALL_CMD = install
29+
UNINSTALL_CMD = rm
2930

3031
#Output filenames for various targets.
3132
ifndef LIBNAME
@@ -93,6 +94,8 @@ install: .common_install
9394

9495
install_bins: .common_install_bins
9596

97+
uninstall: .common_uninstall
98+
9699
profile:
97100
CFLAGS="$(CFLAGS) -fprofile-generate" $(MAKE) timing EXTRALIBS="$(EXTRALIBS) -lgcov"
98101
./timing

makefile.shared

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ ifndef LT
2525
endif
2626
LTCOMPILE = $(LT) --mode=compile --tag=CC $(CC)
2727
INSTALL_CMD = $(LT) --mode=install install
28+
UNINSTALL_CMD = $(LT) --mode=uninstall rm
2829

2930
#Output filenames for various targets.
3031
ifndef LIBNAME
@@ -52,6 +53,9 @@ install: .common_install
5253

5354
install_bins: .common_install_bins
5455

56+
uninstall: .common_uninstall
57+
rm $(DESTDIR)$(LIBPATH)/pkgconfig/libtomcrypt.pc
58+
5559
test: $(LIBNAME) $(TOBJECTS)
5660
$(LT) --mode=link --tag=CC $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o $(TEST) $(TOBJECTS) $(LIBNAME) $(EXTRALIBS)
5761

makefile_include.mk

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ endif
3030
ifndef INSTALL_CMD
3131
$(error your makefile must define INSTALL_CMD)
3232
endif
33+
ifndef UNINSTALL_CMD
34+
$(error your makefile must define UNINSTALL_CMD)
35+
endif
3336

3437
ifndef EXTRALIBS
3538
ifneq ($(shell echo $(CFLAGS) | grep USE_LTM),)
@@ -383,6 +386,12 @@ install_docs: doc/crypt.pdf
383386
install_hooks:
384387
for s in `ls hooks/`; do ln -s ../../hooks/$$s .git/hooks/$$s; done
385388

389+
390+
HEADER_FILES=$(notdir $(HEADERS))
391+
.common_uninstall:
392+
$(UNINSTALL_CMD) $(LIBPATH)/$(LIBNAME)
393+
rm $(HEADER_FILES:%=$(INCPATH)/%)
394+
386395
#This rule cleans the source tree of all compiled code, not including the pdf
387396
#documentation.
388397
clean:

0 commit comments

Comments
 (0)