move biggest part of install rules to makefile.common
This commit is contained in:
parent
2b9dbb4ff7
commit
d996958133
26
makefile
26
makefile
@ -21,6 +21,8 @@ else
|
|||||||
RANLIB:=$(PREFIX)ranlib
|
RANLIB:=$(PREFIX)ranlib
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
INSTALL_CMD = install
|
||||||
|
|
||||||
|
|
||||||
#Output filenames for various targets.
|
#Output filenames for various targets.
|
||||||
ifndef LIBNAME
|
ifndef LIBNAME
|
||||||
@ -281,29 +283,11 @@ endif
|
|||||||
#This rule installs the library and the header files. This must be run
|
#This rule installs the library and the header files. This must be run
|
||||||
#as root in order to have a high enough permission to write to the correct
|
#as root in order to have a high enough permission to write to the correct
|
||||||
#directories and to set the owner and group to root.
|
#directories and to set the owner and group to root.
|
||||||
ifndef NODOCS
|
install: .common_install
|
||||||
install: library docs
|
|
||||||
else
|
|
||||||
install: library
|
|
||||||
endif
|
|
||||||
install -d $(LIBPATH)
|
|
||||||
install -d $(INCPATH)
|
|
||||||
install -m 644 $(LIBNAME) $(LIBPATH)
|
|
||||||
install -m 644 $(HEADERS) $(INCPATH)
|
|
||||||
ifndef NODOCS
|
|
||||||
install -d $(DATAPATH)
|
|
||||||
install -m 644 doc/crypt.pdf $(DATAPATH)
|
|
||||||
endif
|
|
||||||
|
|
||||||
install_bins: $(USEFUL_DEMOS)
|
install_bins: .common_install_bins
|
||||||
install -d $(BINPATH)
|
|
||||||
install -m 775 $(USEFUL_DEMOS) $(BINPATH)
|
|
||||||
|
|
||||||
install_test: $(LIBTEST)
|
install_test: .common_install_test
|
||||||
install -d $(LIBPATH)
|
|
||||||
install -d $(INCPATH)
|
|
||||||
install -m 644 $(LIBTEST) $(LIBPATH)
|
|
||||||
install -m 644 testprof/tomcrypt_test.h $(INCPATH)
|
|
||||||
|
|
||||||
profile:
|
profile:
|
||||||
CFLAGS="$(CFLAGS) -fprofile-generate" $(MAKE) timing EXTRALIBS="$(EXTRALIBS) -lgcov"
|
CFLAGS="$(CFLAGS) -fprofile-generate" $(MAKE) timing EXTRALIBS="$(EXTRALIBS) -lgcov"
|
||||||
|
@ -1,5 +1,9 @@
|
|||||||
#common make targets shared over multiple makefiles
|
#common make targets shared over multiple makefiles
|
||||||
|
|
||||||
|
ifndef INSTALL_CMD
|
||||||
|
$(error your makefile must define INSTALL_CMD)
|
||||||
|
endif
|
||||||
|
|
||||||
bins: $(USEFUL_DEMOS)
|
bins: $(USEFUL_DEMOS)
|
||||||
|
|
||||||
all_test: test tv_gen $(DEMOS)
|
all_test: test tv_gen $(DEMOS)
|
||||||
@ -14,6 +18,30 @@ doxy:
|
|||||||
docs:
|
docs:
|
||||||
$(MAKE) -C doc/ crypt.pdf V=$(V)
|
$(MAKE) -C doc/ crypt.pdf V=$(V)
|
||||||
|
|
||||||
|
|
||||||
|
install_all: install install_bins install_docs install_test
|
||||||
|
|
||||||
|
|
||||||
|
.common_install: $(LIBNAME)
|
||||||
|
install -d $(INCPATH)
|
||||||
|
install -d $(LIBPATH)
|
||||||
|
$(INSTALL_CMD) -m 644 $(LIBNAME) $(LIBPATH)/$(LIBNAME)
|
||||||
|
install -m 644 $(HEADERS) $(INCPATH)
|
||||||
|
|
||||||
|
.common_install_bins: $(USEFUL_DEMOS)
|
||||||
|
install -d $(BINPATH)
|
||||||
|
$(INSTALL_CMD) -m 775 $(USEFUL_DEMOS) $(BINPATH)
|
||||||
|
|
||||||
|
.common_install_test: $(LIBTEST)
|
||||||
|
install -d $(LIBPATH)
|
||||||
|
install -d $(INCPATH)
|
||||||
|
install -m 644 testprof/tomcrypt_test.h $(INCPATH)
|
||||||
|
$(INSTALL_CMD) -m 644 $(LIBTEST) $(LIBPATH)
|
||||||
|
|
||||||
|
install_docs: docs
|
||||||
|
install -d $(DATAPATH)
|
||||||
|
install -m 644 doc/crypt.pdf $(DATAPATH)
|
||||||
|
|
||||||
install_hooks:
|
install_hooks:
|
||||||
for s in `ls hooks/`; do ln -s ../../hooks/$$s .git/hooks/$$s; done
|
for s in `ls hooks/`; do ln -s ../../hooks/$$s .git/hooks/$$s; done
|
||||||
|
|
||||||
|
@ -16,7 +16,7 @@ ifndef LT
|
|||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
LTCOMPILE = $(LT) --mode=compile --tag=CC $(CC)
|
LTCOMPILE = $(LT) --mode=compile --tag=CC $(CC)
|
||||||
|
INSTALL_CMD = $(LT) --mode=install install
|
||||||
|
|
||||||
#Output filenames for various targets.
|
#Output filenames for various targets.
|
||||||
ifndef LIBTEST_S
|
ifndef LIBTEST_S
|
||||||
@ -239,23 +239,14 @@ $(LIBNAME): $(OBJECTS)
|
|||||||
$(LIBTEST): $(TOBJECTS)
|
$(LIBTEST): $(TOBJECTS)
|
||||||
$(LT) --mode=link --tag=CC $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) `find ./testprof -type f -name "*.lo"` -o $@ -rpath $(LIBPATH) -version-info $(VERSION_LT)
|
$(LT) --mode=link --tag=CC $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) `find ./testprof -type f -name "*.lo"` -o $@ -rpath $(LIBPATH) -version-info $(VERSION_LT)
|
||||||
|
|
||||||
install: $(LIBNAME)
|
install: .common_install
|
||||||
install -d $(LIBPATH)/pkgconfig
|
|
||||||
install -d $(INCPATH)
|
|
||||||
$(LT) --mode=install install -c $(LIBNAME) $(LIBPATH)/$(LIBNAME)
|
|
||||||
install -m 644 $(HEADERS) $(INCPATH)
|
|
||||||
sed -e 's,^prefix=.*,prefix=$(DESTDIR),' -e 's,^Version:.*,Version: $(VERSION),' libtomcrypt.pc.in > libtomcrypt.pc
|
sed -e 's,^prefix=.*,prefix=$(DESTDIR),' -e 's,^Version:.*,Version: $(VERSION),' libtomcrypt.pc.in > libtomcrypt.pc
|
||||||
install -m 644 libtomcrypt.pc $(LIBPATH)/pkgconfig/libtomcrypt.pc
|
install -d $(LIBPATH)/pkgconfig
|
||||||
|
install -m 644 libtomcrypt.pc $(LIBPATH)/pkgconfig/
|
||||||
|
|
||||||
install_bins: $(USEFUL_DEMOS)
|
install_bins: .common_install_bins
|
||||||
install -d $(BINPATH)
|
|
||||||
$(LT) --mode=install install -c $(USEFUL_DEMOS) $(BINPATH)
|
|
||||||
|
|
||||||
install_test: $(LIBTEST)
|
install_test: .common_install_test
|
||||||
install -d $(LIBPATH)
|
|
||||||
install -d $(INCPATH)
|
|
||||||
install -m 644 testprof/tomcrypt_test.h $(INCPATH)
|
|
||||||
$(LT) --mode=install install -c $(LIBTEST) $(LIBPATH)/$(LIBTEST)
|
|
||||||
|
|
||||||
test: $(LIBNAME) $(LIBTEST) $(TESTS)
|
test: $(LIBNAME) $(LIBTEST) $(TESTS)
|
||||||
$(LT) --mode=link --tag=CC $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o $(TEST) $(TESTS) $(LIBTEST) $(LIBNAME) $(EXTRALIBS)
|
$(LT) --mode=link --tag=CC $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o $(TEST) $(TESTS) $(LIBTEST) $(LIBNAME) $(EXTRALIBS)
|
||||||
|
Loading…
Reference in New Issue
Block a user