-firm/%.exe: firm/%.s
- @test -z $(RESDIR) || mkdir -p $(RESDIR)
- $(GCC) $(ASM_FLAGS) firm/$*.s -o $@ || echo "$*.c" >> $(RESDIR)/link_failed.txt
+firm/%.exe: %.c
+ @mkdir -p firm
+ @mkdir -p $(RESDIR)
+ $(EDG) $(EDG_CFLAGS) $*.c -o $@ || echo "$*.c" >> $(RESDIR)/link_failed.txt
+
+icc/%.s: %.c
+ @test -z icc || mkdir -p icc
+ $(ICC) $(ICC_CFLAGS) -S $*.c -o $@
+
+.PRECIOUS: icc/%.s
+
+icc/%.exe: icc/%.s
+ @test -z icc || mkdir -p icc
+ $(ICC) $(ICC_CFLAGS) $*.c -o $@