[hw] Only depend on otp-mmap for otp_ctrl in hw/Makefile

This avoids running the generation script unnecessarily for commands
like 'make -C hw regs IPS=aes' or similar.

Signed-off-by: Rupert Swarbrick <rswarbrick@lowrisc.org>
diff --git a/hw/Makefile b/hw/Makefile
index d72d044..689e8dd 100644
--- a/hw/Makefile
+++ b/hw/Makefile
@@ -97,11 +97,14 @@
 # If the ip has a local generation script, run it first. This will
 # require all blocks to use a consistent naming. This should be hooked
 # into ipgen (see #5636) for completeness.
-$(ips_reg): %_reg: otp-mmap lc-state-enc | $(REG_OUTPUT_DV_DIR)
+$(ips_reg): %_reg: lc-state-enc | $(REG_OUTPUT_DV_DIR)
 	$(if $(wildcard $(blk-gen-script)),$(blk-gen-script))
 	${PRJ_DIR}/util/regtool.py ${toolflags} -r $(blk-hjson)
 	${PRJ_DIR}/util/regtool.py -s -t $(REG_OUTPUT_DV_DIR) $(blk-hjson)
 
+# Register generation for otp_ctrl also depends on running gen-otp-mmap.py
+.PHONY: otp-mmap
+$(filter otp_ctrl_reg,$(ips_reg)): otp-mmap
 otp-mmap:
 	cd ${PRJ_DIR} && ./util/design/gen-otp-mmap.py
 
@@ -137,4 +140,4 @@
 		-r -o ${REG_OUTPUT_DV_DIR}/$($@_TOP) ${toolflags}
 
 
-.PHONY: all otp-mmap lc-state-enc
+.PHONY: all lc-state-enc