Skip to content

Commit

Permalink
Fix Makefiles to support Windows EXEEXT usage (verilator#3008).
Browse files Browse the repository at this point in the history
  • Loading branch information
mmicko committed Jun 4, 2021
1 parent eea7e1b commit fa06357
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 22 deletions.
25 changes: 13 additions & 12 deletions Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
srcdir = @srcdir@
VPATH = @srcdir@
HOST = @HOST@
EXEEXT = @EXEEXT@

DOXYGEN = doxygen
INSTALL = @INSTALL@
Expand Down Expand Up @@ -203,9 +204,9 @@ INST_PROJ_FILES = \
include/vltstd/*.[chv]* \

INST_PROJ_BIN_FILES = \
bin/verilator_bin \
bin/verilator_bin_dbg \
bin/verilator_coverage_bin_dbg \
bin/verilator_bin$(EXEEXT) \
bin/verilator_bin_dbg$(EXEEXT) \
bin/verilator_coverage_bin_dbg$(EXEEXT) \

EXAMPLES_FIRST = \
examples/make_hello_c \
Expand All @@ -221,10 +222,10 @@ all: all_nomsg msg_test
all_nomsg: verilator_exe $(VL_INST_MAN_FILES)

.PHONY:verilator_exe
.PHONY:verilator_bin
.PHONY:verilator_bin_dbg
.PHONY:verilator_coverage_bin_dbg
verilator_exe verilator_bin verilator_bin_dbg verilator_coverage_bin_dbg:
.PHONY:verilator_bin$(EXEEXT)
.PHONY:verilator_bin_dbg$(EXEEXT)
.PHONY:verilator_coverage_bin_dbg$(EXEEXT)
verilator_exe verilator_bin$(EXEEXT) verilator_bin_dbg$(EXEEXT) verilator_coverage_bin_dbg$(EXEEXT):
@echo ------------------------------------------------------------
@echo "making verilator in src"
$(MAKE) -C src $(OBJCACHE_JOBS) $(CI_MAKE_SRC_TARGET)
Expand Down Expand Up @@ -280,7 +281,7 @@ verilator.pdf: Makefile
$(MAKE) -C docs verilator.pdf

# See uninstall also - don't put wildcards in this variable, it might uninstall other stuff
VL_INST_BIN_FILES = verilator verilator_bin verilator_bin_dbg verilator_coverage_bin_dbg \
VL_INST_BIN_FILES = verilator verilator_bin$(EXEEXT) verilator_bin_dbg$(EXEEXT) verilator_coverage_bin_dbg$(EXEEXT) \
verilator_coverage verilator_gantt verilator_includer verilator_profcfunc
# Some scripts go into both the search path and pkgdatadir,
# so they can be found by the user, and under $VERILATOR_ROOT.
Expand All @@ -305,9 +306,9 @@ installbin:
( cd ${srcdir}/bin ; $(INSTALL_PROGRAM) verilator_coverage $(DESTDIR)$(bindir)/verilator_coverage )
( cd ${srcdir}/bin ; $(INSTALL_PROGRAM) verilator_gantt $(DESTDIR)$(bindir)/verilator_gantt )
( cd ${srcdir}/bin ; $(INSTALL_PROGRAM) verilator_profcfunc $(DESTDIR)$(bindir)/verilator_profcfunc )
( cd bin ; $(INSTALL_PROGRAM) verilator_bin $(DESTDIR)$(bindir)/verilator_bin )
( cd bin ; $(INSTALL_PROGRAM) verilator_bin_dbg $(DESTDIR)$(bindir)/verilator_bin_dbg )
( cd bin ; $(INSTALL_PROGRAM) verilator_coverage_bin_dbg $(DESTDIR)$(bindir)/verilator_coverage_bin_dbg )
( cd bin ; $(INSTALL_PROGRAM) verilator_bin$(EXEEXT) $(DESTDIR)$(bindir)/verilator_bin$(EXEEXT) )
( cd bin ; $(INSTALL_PROGRAM) verilator_bin_dbg$(EXEEXT) $(DESTDIR)$(bindir)/verilator_bin_dbg$(EXEEXT) )
( cd bin ; $(INSTALL_PROGRAM) verilator_coverage_bin_dbg$(EXEEXT) $(DESTDIR)$(bindir)/verilator_coverage_bin_dbg$(EXEEXT) )
$(MKINSTALLDIRS) $(DESTDIR)$(pkgdatadir)/bin
( cd ${srcdir}/bin ; $(INSTALL_PROGRAM) verilator_includer $(DESTDIR)$(pkgdatadir)/bin/verilator_includer )

Expand Down Expand Up @@ -458,7 +459,7 @@ clang-tidy: $(CLANGTIDY_DEP)

analyzer-src:
-rm -rf src/obj_dbg
scan-build $(MAKE) -k verilator_coverage_bin_dbg verilator_bin_dbg
scan-build $(MAKE) -k verilator_coverage_bin_dbg$(EXEEXT) verilator_bin_dbg$(EXEEXT)

analyzer-include:
-rm -rf examples/*/obj*
Expand Down
1 change: 1 addition & 0 deletions docs/CONTRIBUTORS
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ Marshal Qiao
Matthew Ballance
Michael Killough
Mike Popoloski
Miodrag Milanović
Morten Borup Petersen
Nandu Raj
Nathan Kohagen
Expand Down
18 changes: 9 additions & 9 deletions src/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -47,25 +47,25 @@ obj_dbg:

.SUFFIXES:

.PHONY: ../bin/verilator_bin ../bin/verilator_bin_dbg ../bin/verilator_coverage_bin_dbg
.PHONY: ../bin/verilator_bin$(EXEEXT) ../bin/verilator_bin_dbg$(EXEEXT) ../bin/verilator_coverage_bin_dbg$(EXEEXT)

opt: ../bin/verilator_bin
opt: ../bin/verilator_bin$(EXEEXT)
ifeq ($(VERILATOR_NO_OPT_BUILD),1) # Faster laptop development... One build
../bin/verilator_bin: ../bin/verilator_bin_dbg
-cp -p $<$(EXEEXT) $@$(EXEEXT).tmp
-mv -f $@$(EXEEXT).tmp $@$(EXEEXT)
../bin/verilator_bin$(EXEEXT): ../bin/verilator_bin_dbg$(EXEEXT)
-cp -p $< $@.tmp
-mv -f $@.tmp $@
else
../bin/verilator_bin: obj_opt ../bin prefiles
../bin/verilator_bin$(EXEEXT): obj_opt ../bin prefiles
$(MAKE) -C obj_opt -j 1 TGT=../$@ -f ../Makefile_obj serial
$(MAKE) -C obj_opt TGT=../$@ -f ../Makefile_obj
endif

dbg: ../bin/verilator_bin_dbg ../bin/verilator_coverage_bin_dbg
../bin/verilator_bin_dbg: obj_dbg ../bin prefiles
dbg: ../bin/verilator_bin_dbg$(EXEEXT) ../bin/verilator_coverage_bin_dbg$(EXEEXT)
../bin/verilator_bin_dbg$(EXEEXT): obj_dbg ../bin prefiles
$(MAKE) -C obj_dbg -j 1 TGT=../$@ VL_DEBUG=1 -f ../Makefile_obj serial
$(MAKE) -C obj_dbg TGT=../$@ VL_DEBUG=1 -f ../Makefile_obj

../bin/verilator_coverage_bin_dbg: obj_dbg ../bin prefiles
../bin/verilator_coverage_bin_dbg$(EXEEXT): obj_dbg ../bin prefiles
$(MAKE) -C obj_dbg TGT=../$@ VL_DEBUG=1 VL_VLCOV=1 -f ../Makefile_obj serial_vlcov
$(MAKE) -C obj_dbg TGT=../$@ VL_DEBUG=1 VL_VLCOV=1 -f ../Makefile_obj

Expand Down
2 changes: 1 addition & 1 deletion src/Makefile_obj.in
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ CFG_LIBS = @CFG_LIBS@
#### End of system configuration section. ####

VPATH += . $(bldsrc) $(srcdir)
TGT = ../../verilator_bin
TGT = ../../verilator_bin$(EXEEXT)

#################
ifeq ($(VL_DEBUG),)
Expand Down

0 comments on commit fa06357

Please sign in to comment.