[Makefile] added a drc-(block) target in the makefile - drc on gds.
diff --git a/Makefile b/Makefile
index b01f148..90fdc94 100644
--- a/Makefile
+++ b/Makefile
@@ -111,7 +111,16 @@
 	python3 ./scripts/count_lvs.py -f ./verilog/gl/$*.v_comp.json
 	mv -f ./verilog/gl/*{.out,.json,.log} ./spi/lvs/tmp 2> /dev/null || true
 	@echo "Comparison result: ./spi/lvs/tmp/$*.v_comp.out"
-	
+
+# DRC
+BLOCKS = $(shell cd openlane && find * -maxdepth 0 -type d)
+DRC_BLOCKS = $(foreach block, $(BLOCKS), drc-$(block))
+$(DRC_BLOCKS): drc-% : ./gds/%.gds
+	echo "Running DRC on $*"
+	mkdir -p ./gds/tmp
+	cd gds && export DESIGN_IN_DRC=$* && export MAGTYPE=mag; magic -rcfile ${PDK_ROOT}/sky130A/libs.tech/magic/current/sky130A.magicrc -noc -dnull drc_on_gds.tcl < /dev/null
+	@echo "DRC result: ./gds/tmp/$*.drc"
+
 
 .PHONY: help
 help:
diff --git a/gds/drc_on_gds.tcl b/gds/drc_on_gds.tcl
new file mode 100644
index 0000000..bc1941f
--- /dev/null
+++ b/gds/drc_on_gds.tcl
@@ -0,0 +1,48 @@
+
+set ::env(DESIGN_IN_DRC) [lindex $argv 0]
+gds read $::env(DESIGN_IN_DRC).gds
+set fout [open ./tmp/$::env(DESIGN_IN_DRC).drc w]
+set oscale [cif scale out]
+set cell_name $::env(DESIGN_IN_DRC)
+magic::suspendall
+puts stdout "\[INFO\]: Loading $::env(DESIGN_IN_DRC)\n"
+flush stdout
+load $::env(DESIGN_IN_DRC)
+select top cell
+drc euclidean on
+drc style drc(full)
+drc check
+set drcresult [drc listall why]
+set count 0
+puts $fout "$::env(DESIGN_IN_DRC)"
+puts $fout "----------------------------------------"
+foreach {errtype coordlist} $drcresult {
+    puts $fout $errtype
+    puts $fout "----------------------------------------"
+    foreach coord $coordlist {
+        set bllx [expr {$oscale * [lindex $coord 0]}]
+        set blly [expr {$oscale * [lindex $coord 1]}]
+        set burx [expr {$oscale * [lindex $coord 2]}]
+        set bury [expr {$oscale * [lindex $coord 3]}]
+        set coords [format " %.3f %.3f %.3f %.3f" $bllx $blly $burx $bury]
+        puts $fout "$coords"
+        set count [expr {$count + 1} ]
+    }
+    puts $fout "----------------------------------------"
+}
+
+puts $fout "\[INFO\]: COUNT: $count"
+puts $fout "\[INFO\]: Should be divided by 3 or 4"
+
+puts $fout ""
+close $fout
+
+puts stdout "\[INFO\]: COUNT: $count"
+puts stdout "\[INFO\]: Should be divided by 3 or 4"
+puts stdout "\[INFO\]: DRC Checking DONE (./tmp/$::env(DESIGN_IN_DRC).drc)"
+flush stdout
+
+puts stdout "\[INFO\]: Saving mag view with DRC errors(./tmp/$::env(DESIGN_IN_DRC).drc.mag)"
+# WARNING: changes the name of the cell; keep as last step
+save ./tmp/$::env(DESIGN_IN_DRC).drc.drc.mag
+puts stdout "\[INFO\]: Saved"