@@ -203,11 +203,21 @@ verilator.html:
203
203
verilator.pdf : Makefile
204
204
$(MAKE ) -C docs verilator.pdf
205
205
206
- # See uninstall also - don't put wildcards in this variable, it might uninstall other stuff
207
- VL_INST_BIN_FILES = verilator verilator_bin$(EXEEXT ) verilator_bin_dbg$(EXEEXT ) verilator_coverage_bin_dbg$(EXEEXT ) \
208
- verilator_ccache_report verilator_coverage verilator_difftree verilator_gantt verilator_includer verilator_profcfunc
209
- # Some scripts go into both the search path and pkgdatadir,
210
- # so they can be found by the user, and under $VERILATOR_ROOT.
206
+ # Public executables intended to be invoked directly by the user
207
+ # Don't put wildcards in these variables, it might cause an uninstall of other stuff
208
+ VL_INST_PUBLIC_SCRIPT_FILES = verilator \
209
+ verilator_coverage \
210
+ verilator_gantt \
211
+ verilator_profcfunc \
212
+
213
+ VL_INST_PUBLIC_BIN_FILES = verilator_bin$(EXEEXT ) \
214
+ verilator_bin_dbg$(EXEEXT ) \
215
+ verilator_coverage_bin_dbg$(EXEEXT ) \
216
+
217
+ # Private executabels intended to be invoked by internals
218
+ # Don't put wildcards in these variables, it might cause an uninstall of other stuff
219
+ VL_INST_PRIVATE_SCRIPT_FILES = verilator_ccache_report \
220
+ verilator_includer \
211
221
212
222
VL_INST_INC_BLDDIR_FILES = \
213
223
include/verilated_config.h \
@@ -226,19 +236,34 @@ VL_INST_DATA_SRCDIR_FILES = \
226
236
examples/*/Makefile* \
227
237
examples/*/vl_* \
228
238
229
- installbin :
230
- $(MKINSTALLDIRS ) $(DESTDIR )$(bindir )
231
- ( cd ${srcdir} /bin ; $( INSTALL_PROGRAM) verilator $( DESTDIR) $( bindir) /verilator )
232
- ( cd ${srcdir} /bin ; $( INSTALL_PROGRAM) verilator_coverage $( DESTDIR) $( bindir) /verilator_coverage )
233
- ( cd ${srcdir} /bin ; $( INSTALL_PROGRAM) verilator_gantt $( DESTDIR) $( bindir) /verilator_gantt )
234
- ( cd ${srcdir} /bin ; $( INSTALL_PROGRAM) verilator_profcfunc $( DESTDIR) $( bindir) /verilator_profcfunc )
235
- ( cd bin ; $( INSTALL_PROGRAM) verilator_bin$( EXEEXT) $( DESTDIR) $( bindir) /verilator_bin$( EXEEXT) )
236
- ( cd bin ; $( INSTALL_PROGRAM) verilator_bin_dbg$( EXEEXT) $( DESTDIR) $( bindir) /verilator_bin_dbg$( EXEEXT) )
237
- ( cd bin ; $( INSTALL_PROGRAM) verilator_coverage_bin_dbg$( EXEEXT) $( DESTDIR) $( bindir) /verilator_coverage_bin_dbg$( EXEEXT) )
239
+ mkbindirs :
238
240
$(MKINSTALLDIRS ) $(DESTDIR )$(pkgdatadir ) /bin
239
- ( cd ${srcdir} /bin ; $( INSTALL_PROGRAM) verilator_includer $( DESTDIR) $( pkgdatadir) /bin/verilator_includer )
240
- ( cd ${srcdir} /bin ; $( INSTALL_PROGRAM) verilator_ccache_report $( DESTDIR) $( pkgdatadir) /bin/verilator_ccache_report )
241
- ( cd ${srcdir} /bin ; $( INSTALL_PROGRAM) verilator_difftree $( DESTDIR) $( pkgdatadir) /bin/verilator_difftree )
241
+ $(MKINSTALLDIRS ) $(DESTDIR )$(bindir )
242
+
243
+ installbin : | mkbindirs
244
+ cd $(srcdir ) /bin; \
245
+ for p in $( VL_INST_PUBLIC_SCRIPT_FILES) ; do \
246
+ $(INSTALL_PROGRAM ) $$ p $(DESTDIR )$(pkgdatadir ) /bin/$$ p; \
247
+ done
248
+ cd bin; \
249
+ for p in $( VL_INST_PUBLIC_BIN_FILES) ; do \
250
+ $(INSTALL_PROGRAM ) $$ p $(DESTDIR )$(pkgdatadir ) /bin/$$ p; \
251
+ done
252
+ cd $(srcdir ) /bin; \
253
+ for p in $( VL_INST_PRIVATE_SCRIPT_FILES) ; do \
254
+ $(INSTALL_PROGRAM ) $$ p $(DESTDIR )$(pkgdatadir ) /bin/$$ p; \
255
+ done
256
+
257
+ installredirect : installbin | mkbindirs
258
+ cp ${srcdir} /bin/redirect ${srcdir} /bin/redirect.tmp
259
+ perl -p -i -e ' use File::Spec;' \
260
+ -e' $$path = File::Spec->abs2rel("$(realpath $(DESTDIR)$(pkgdatadir)/bin)", "$(realpath $(DESTDIR)$(bindir))");' \
261
+ -e ' s/RELPATH.*/"$$path";/g' -- " ${srcdir} /bin/redirect.tmp"
262
+ cd $(srcdir ) /bin; \
263
+ for p in $( VL_INST_PUBLIC_SCRIPT_FILES) $( VL_INST_PUBLIC_BIN_FILES) ; do \
264
+ $(INSTALL_PROGRAM ) redirect.tmp $(DESTDIR )$(bindir ) /$$ p; \
265
+ done
266
+ rm ${srcdir} /bin/redirect.tmp
242
267
243
268
# Man files can either be part of the original kit, or built in current directory
244
269
# So important we use $^ so VPATH is searched
@@ -281,8 +306,11 @@ installdata:
281
306
282
307
# We don't trust rm -rf, so rmdir instead as it will fail if user put in other files
283
308
uninstall :
284
- -cd $(DESTDIR )$(bindir ) && rm -f $(VL_INST_BIN_FILES )
285
- -cd $(DESTDIR )$(pkgdatadir ) /bin && rm -f $(VL_INST_BIN_FILES )
309
+ -cd $(DESTDIR )$(bindir ) && rm -f $(VL_INST_PUBLIC_SCRIPT_FILES )
310
+ -cd $(DESTDIR )$(bindir ) && rm -f $(VL_INST_PUBLIC_BIN_FILES )
311
+ -cd $(DESTDIR )$(pkgdatadir ) /bin && rm -f $(VL_INST_PUBLIC_SCRIPT_FILES )
312
+ -cd $(DESTDIR )$(pkgdatadir ) /bin && rm -f $(VL_INST_PUBLIC_BIN_FILES )
313
+ -cd $(DESTDIR )$(pkgdatadir ) /bin && rm -f $(VL_INST_PRIVATE_SCRIPT_FILES )
286
314
-cd $(DESTDIR )$(mandir ) /man1 && rm -f $(VL_INST_MAN_FILES )
287
315
-cd $(DESTDIR )$(pkgdatadir ) && rm -f $(VL_INST_INC_BLDDIR_FILES )
288
316
-cd $(DESTDIR )$(pkgdatadir ) && rm -f $(VL_INST_INC_SRCDIR_FILES )
@@ -311,7 +339,7 @@ uninstall:
311
339
-rmdir $(DESTDIR )$(pkgconfigdir )
312
340
313
341
install : all_nomsg install-all
314
- install-all : installbin installman installdata install-msg
342
+ install-all : installbin installredirect installman installdata install-msg
315
343
316
344
install-here : installman info
317
345
0 commit comments