Add DESTDIR to Makefiles to assist RPM construction. [Gunter Dannoritzer]

git-svn-id: file://localhost/svn/verilator/trunk/verilator@1052 77ca24e4-aefa-0310-84f0-b9a241c72d87
This commit is contained in:
Wilson Snyder 2008-05-07 17:46:33 +00:00
parent 36e84973ec
commit a4e2a770f6
2 changed files with 21 additions and 16 deletions

View File

@ -5,6 +5,8 @@ indicates the contributor was also the author of the fix; Thanks!
* Verilator 3.66*** * Verilator 3.66***
**** Add DESTDIR to Makefiles to assist RPM construction. [Gunter Dannoritzer]
**** Fix compiler warnings under GCC 4.2.1. **** Fix compiler warnings under GCC 4.2.1.
**** Fix preprocessor `else after series of `elsif. [Mark Nodine] **** Fix preprocessor `else after series of `elsif. [Mark Nodine]

View File

@ -61,6 +61,9 @@ MAKEINFO = makeinfo
TEXI2DVI = texi2dvi TEXI2DVI = texi2dvi
PERL = @PERL@ PERL = @PERL@
# Destination prefix for RPMs
DESTDIR =
#### Don't edit: You're much better using configure switches to set these #### Don't edit: You're much better using configure switches to set these
prefix = @prefix@ prefix = @prefix@
exec_prefix = @exec_prefix@ exec_prefix = @exec_prefix@
@ -213,26 +216,26 @@ README: readme.texi
# See uninstall also # See uninstall also
VL_INST_BIN_FILES = verilator verilator_bin verilator_bin_dbg VL_INST_BIN_FILES = verilator verilator_bin verilator_bin_dbg
installbin: installbin:
$(SHELL) ${srcdir}/mkinstalldirs $(bindir) $(SHELL) ${srcdir}/mkinstalldirs $(DESTDIR)$(bindir)
( cd bin ; $(INSTALL_PROGRAM) verilator $(bindir)/verilator ) ( cd bin ; $(INSTALL_PROGRAM) verilator $(DESTDIR)$(bindir)/verilator )
( $(INSTALL_PROGRAM) verilator_bin $(bindir)/verilator_bin ) ( $(INSTALL_PROGRAM) verilator_bin $(DESTDIR)$(bindir)/verilator_bin )
( $(INSTALL_PROGRAM) verilator_bin_dbg $(bindir)/verilator_bin_dbg ) ( $(INSTALL_PROGRAM) verilator_bin_dbg $(DESTDIR)$(bindir)/verilator_bin_dbg )
VL_INST_MAN_FILES = verilator.1 VL_INST_MAN_FILES = verilator.1
installman: installman:
$(SHELL) ${srcdir}/mkinstalldirs $(mandir) $(SHELL) ${srcdir}/mkinstalldirs $(DESTDIR)$(mandir)/man1
for p in $(VL_INST_MAN_FILES) ; do \ for p in $(VL_INST_MAN_FILES) ; do \
$(INSTALL_PROGRAM) $$p $(mandir)/man1/$$p; \ $(INSTALL_PROGRAM) $$p $(DESTDIR)$(mandir)/man1/$$p; \
done done
installdata: installdata:
$(SHELL) ${srcdir}/mkinstalldirs $(pkgdatadir)/examples $(SHELL) ${srcdir}/mkinstalldirs $(DESTDIR)$(pkgdatadir)/examples
cp -r include $(pkgdatadir) cp -r include $(DESTDIR)$(pkgdatadir)
cp -r src $(pkgdatadir) cp -r src $(DESTDIR)$(pkgdatadir)
cp -r test_c $(pkgdatadir)/examples cp -r test_c $(DESTDIR)$(pkgdatadir)/examples
cp -r test_sc $(pkgdatadir)/examples cp -r test_sc $(DESTDIR)$(pkgdatadir)/examples
cp -r test_sp $(pkgdatadir)/examples cp -r test_sp $(DESTDIR)$(pkgdatadir)/examples
cp -r test_v $(pkgdatadir)/examples cp -r test_v $(DESTDIR)$(pkgdatadir)/examples
VL_INST_DATA_FILES = verilator.1 VL_INST_DATA_FILES = verilator.1
install: all_nomsg installbin installman installdata install-msg install: all_nomsg installbin installman installdata install-msg
@ -276,9 +279,9 @@ install-msg:
@echo @echo
uninstall: uninstall:
-cd $(mandir)/man1 && rm -f $(VL_INST_MAN_FILES) -cd $(DESTDIR)$(mandir)/man1 && rm -f $(VL_INST_MAN_FILES)
-cd $(bindir) && rm -f $(VL_INST_BIN_FILES) -cd $(DESTDIR)$(bindir) && rm -f $(VL_INST_BIN_FILES)
-rm -f $(pkgdatadir) -rm -f $(DESTDIR)$(pkgdatadir)
# autoheader might not change config_build.h.in, so touch a stamp file. # autoheader might not change config_build.h.in, so touch a stamp file.
IN_WILD := ${srcdir}/*.in ${srcdir}/*/*.in ${srcdir}/*/*/*.in \ IN_WILD := ${srcdir}/*.in ${srcdir}/*/*.in ${srcdir}/*/*/*.in \