Index: asp3_wo_tecs/trunk/sample/Makefile
===================================================================
--- asp3_wo_tecs/trunk/sample/Makefile	(revision 302)
+++ asp3_wo_tecs/trunk/sample/Makefile	(revision 304)
@@ -192,7 +192,8 @@
 #  ã¿ã¼ã²ãããã¡ã¤ã«ï¼è¤æ°ãåæã«é¸æãã¦ã¯ãªããªãï¼
 #
-all: $(OBJFILE)
-#all: $(OBJNAME).bin
-#all: $(OBJNAME).srec
+.PHONY: all
+all: check
+#all: check $(OBJNAME).bin
+#all: check $(OBJNAME).srec
 
 ##### ä»¥ä¸ã¯ç·¨éããªããã¨ #####
@@ -201,6 +202,6 @@
 #  ã³ã³ãã£ã®ã¥ã¬ã¼ã¿ã«é¢ããå®ç¾©
 #
-CFG_TABS := --api-table $(SRCDIR)/kernel/kernel_api.csv \
-			--cfg1-def-table $(SRCDIR)/kernel/kernel_def.csv $(CFG_TABS)
+CFG_TABS := --api-table $(SRCDIR)/kernel/kernel_api.def \
+			--symval-table $(SRCDIR)/kernel/kernel_sym.def $(CFG_TABS)
 CFG_ASMOBJS := $(CFG_ASMOBJS)
 CFG_COBJS := kernel_cfg.o $(CFG_COBJS)
@@ -243,12 +244,15 @@
 	OFFSET_H = offset.h
 endif
-ifndef OFFSET_TF
-	OFFSET_TF := $(TARGETDIR)/target_offset.tf
-endif
-ifndef TARGET_TF
-	TARGET_TF := $(TARGETDIR)/target.tf
-endif
-ifndef TARGET_CHECK_TF
-	TARGET_CHECK_TF := $(TARGETDIR)/target_check.tf
+ifndef TARGET_OFFSET_TRB
+	TARGET_OFFSET_TRB := $(TARGETDIR)/target_offset.trb
+endif
+ifndef TARGET_KERNEL_TRB
+	TARGET_KERNEL_TRB := $(TARGETDIR)/target_kernel.trb
+endif
+ifndef TARGET_CHECK_TRB
+	TARGET_CHECK_TRB := $(TARGETDIR)/target_check.trb
+endif
+ifndef TARGET_KERNEL_CFG
+	TARGET_KERNEL_CFG := $(TARGETDIR)/target_kernel.cfg
 endif
 
@@ -291,29 +295,30 @@
 #  ã«ã¼ãã«ã®ã³ã³ãã£ã®ã¥ã¬ã¼ã·ã§ã³ãã¡ã¤ã«ã®çæ
 #
-cfg1_out.c: $(APPL_CFG)
-	$(CFG) --pass 1 --kernel asp $(INCLUDES) $(CFG_TABS) $<
-	$(CFG) -M cfg1_out.c $(INCLUDES) $< > $(DEPDIR)/cfg1_out_c.d
-
-$(CFG1_OUT) cfg1_out.syms cfg1_out.srec: \
-					$(START_OBJS) cfg1_out.o $(END_OBJS) $(HIDDEN_OBJS)
+cfg1_out.c cfg1_out.db: cfg1_out.timestamp ;
+cfg1_out.timestamp: $(APPL_CFG) $(TECSGEN_TIMESTAMP)
+	$(CFG) --pass 1 --kernel asp $(INCLUDES) $(CFG_TABS) \
+						-M $(DEPDIR)/cfg1_out_c.d $(TARGET_KERNEL_CFG) $<
+
+$(CFG1_OUT): $(START_OBJS) cfg1_out.o $(END_OBJS) $(HIDDEN_OBJS)
 	$(LINK) $(CFLAGS) $(LDFLAGS) $(CFG1_OUT_LDFLAGS) -o $(CFG1_OUT) \
 						$(START_OBJS) cfg1_out.o $(END_OBJS)
+
+cfg1_out.syms: $(CFG1_OUT)
 	$(NM) -n $(CFG1_OUT) > cfg1_out.syms
+
+cfg1_out.srec: $(CFG1_OUT)
 	$(OBJCOPY) -O srec -S $(CFG1_OUT) cfg1_out.srec
 
-$(CFG2_OUT_SRCS): kernel_cfg.timestamp
-kernel_cfg.timestamp: $(APPL_CFG) cfg1_out.syms cfg1_out.srec
-	$(CFG) --pass 2 --kernel asp $(INCLUDES) -T $(TARGET_TF) $(CFG_TABS) $<
-	$(SRCDIR)/utils/move-if-change kernel_cfg.h.new kernel_cfg.h
+$(CFG2_OUT_SRCS) cfg2_out.db: kernel_cfg.timestamp ;
+kernel_cfg.timestamp: cfg1_out.db cfg1_out.syms cfg1_out.srec
+	$(CFG) --pass 2 --kernel asp $(INCLUDES) -T $(TARGET_KERNEL_TRB)
 
 #
 #  ãªãã»ãããã¡ã¤ã«ï¼offset.hï¼ã®çæè¦å
 #
-$(OFFSET_H): offset.timestamp
-offset.timestamp: $(APPL_CFG) cfg1_out.syms cfg1_out.srec
-	$(CFG) --pass 3 --kernel asp $(INCLUDES) \
-				--rom-image cfg1_out.srec --symbol-table cfg1_out.syms \
-				-T $(OFFSET_TF) $(CFG_TABS) $<
-	$(SRCDIR)/utils/move-if-change offset.h.new offset.h
+$(OFFSET_H): offset.timestamp ;
+offset.timestamp: cfg1_out.db cfg1_out.syms cfg1_out.srec
+	$(CFG) --pass 2 -O --kernel asp $(INCLUDES) -T $(TARGET_OFFSET_TRB) \
+				--rom-symbol cfg1_out.syms --rom-image cfg1_out.srec
 
 #
@@ -334,13 +339,14 @@
 ¨ä½ã®ãªã³ã¯
 #
-$(OBJFILE): $(APPL_CFG) kernel_cfg.h $(ALL_OBJS) $(LIBS_DEP)
+$(OBJFILE): $(ALL_OBJS) $(LIBS_DEP)
 	$(LINK) $(CFLAGS) $(LDFLAGS) $(OBJ_LDFLAGS) -o $(OBJFILE) \
 			$(START_OBJS) $(APPL_OBJS) $(SYSSVC_OBJS) $(CFG_OBJS) \
 			$(ALL_LIBS) $(END_OBJS)
+
+#
+#  ã·ã³ãã«ãã¡ã¤ã«ã®çæ
+#
+$(OBJNAME).syms: $(OBJFILE)
 	$(NM) -n $(OBJFILE) > $(OBJNAME).syms
-	$(OBJCOPY) -O srec -S $(OBJFILE) $(OBJNAME).srec
-	$(CFG) --pass 3 --kernel asp $(INCLUDES) \
-				--rom-image $(OBJNAME).srec --symbol-table $(OBJNAME).syms \
-				-T $(TARGET_CHECK_TF) $(CFG_TABS) $<
 
 #
@@ -356,4 +362,11 @@
 	$(OBJCOPY) -O srec -S $(OBJFILE) $(OBJNAME).srec
 
+.PHONY: check
+check: check.timestamp ;
+check.timestamp: cfg2_out.db $(OBJNAME).syms $(OBJNAME).srec
+	$(CFG) --pass 3 --kernel asp $(INCLUDES) -T $(TARGET_CHECK_TRB) \
+				--rom-symbol $(OBJNAME).syms --rom-image $(OBJNAME).srec
+	@echo "configuration check passed"
+
 #
 #  ã³ã³ãã¤ã«çµæã®æ¶å»
@@ -361,9 +374,10 @@
 .PHONY: clean
 clean:
-	rm -f \#* *~ *.o $(CLEAN_FILES) offset.timestamp $(OFFSET_H)
+	rm -f \#* *~ *.o $(DEPDIR)/*.d $(CLEAN_FILES) check.timestamp
 	rm -f $(OBJFILE) $(OBJNAME).syms $(OBJNAME).srec $(OBJNAME).bin
-	rm -f kernel_cfg.timestamp $(CFG2_OUT_SRCS)
-	rm -f cfg1_out.c $(CFG1_OUT) cfg1_out.syms cfg1_out.srec
-	rm -f $(DEPDIR)/*.d
+	rm -f kernel_cfg.timestamp $(CFG2_OUT_SRCS) cfg2_out.db
+	rm -f offset.timestamp $(OFFSET_H)
+	rm -f cfg1_out.syms cfg1_out.srec $(CFG1_OUT)
+	rm -f cfg1_out.timestamp cfg1_out.c cfg1_out.db
 ifndef KERNEL_LIB
 	rm -f libkernel.a
