Index: EcnlProtoTool/trunk/ntshell/Debug/Makefile
===================================================================
--- EcnlProtoTool/trunk/ntshell/Debug/Makefile	(revision 427)
+++ EcnlProtoTool/trunk/ntshell/Debug/Makefile	(revision 429)
@@ -6,5 +6,5 @@
 #  Copyright (C) 2000-2003 by Embedded and Real-Time Systems Laboratory
 #                              Toyohashi Univ. of Technology, JAPAN
-#  Copyright (C) 2006-2016 by Embedded and Real-Time Systems Laboratory
+#  Copyright (C) 2006-2019 by Embedded and Real-Time Systems Laboratory
 #              Graduate School of Information Science, Nagoya Univ., JAPAN
 # 
@@ -96,4 +96,10 @@
 
 #
+#  ã·ã¹ãã ãµã¼ãã¹ã³ã¼ã«ã©ã¤ãã©ãªï¼libsyssvc.aï¼ã®ãã£ã¬ã¯ããªå
+#  ï¼ã·ã¹ãã ãµã¼ãã¹ã³ã¼ã«ã©ã¤ãã©ãªãmakeå¯¾è±¡ã«ããæã¯ï¼ç©ºã«å®ç¾©ããï¼
+#
+SYSSVC_LIB = ../../asp3_dcre/Debug
+
+#
 #  ã«ã¼ãã«ãé¢æ°åä½ã§ã³ã³ãã¤ã«ãããã©ããã®å®ç¾©
 #
@@ -104,4 +110,9 @@
 #
 OMIT_TECS = 
+
+#
+#  TECSé¢ä¿ãã¡ã¤ã«ã®ãã£ã¬ã¯ããªã®å®ç¾©
+#
+TECSDIR = 
 
 #
@@ -134,7 +145,8 @@
 
 #
-#  ä¾å­é¢ä¿ãã¡ã¤ã«ãç½®ããã£ã¬ã¯ããªã®å®ç¾©
-#
-DEPDIR = deps
+#  ä¸­éãªãã¸ã§ã¯ããã¡ã¤ã«ã¨ä¾å­é¢ä¿ãã¡ã¤ã«ãç½®ããã£ã¬ã¯ããªã®å®ç¾©
+#
+OBJDIR = obj
+DEPDIR = obj
 
 #
@@ -165,4 +177,6 @@
 endif
 
+TINETDIR = tinet
+
 #
 #  mbedãµã¼ãã¹ã®å®ç¾©
@@ -175,5 +189,5 @@
 ±éã³ã³ãã¤ã«ãªãã·ã§ã³ã®å®ç¾©
 #
-COPTS := -g -std=gnu99 $(COPTS)
+COPTS := -g -std=gnu99 -ffunction-sections -fdata-sections $(COPTS)
 ifndef OMIT_WARNING_ALL
 	COPTS := -Wall $(COPTS)
@@ -207,5 +221,5 @@
 	APPL_COBJS := main.o fdtable.o io_stub.o socket_stub.o ffarch.o fftime.o tlsf.o diskio.o ff.o sdfs.o ccsbcs.o base64.o http-strings.o http_parser.o httpd.o httpd-fs.o sha1.o websocket.o websocket_fbs.o ntshell.o text_editor.o text_history.o usrcmd.o vtrecv.o vtsend.o ntlibc.o ntstdio.o ntopt.o syscall.o mbedcall.o
 endif
-APPL_COBJS := $(APPL_COBJS) log_output.o vasyslog.o t_perror.o strerror.o
+APPL_COBJS := $(APPL_COBJS) log_output.o vasyslog.o t_perror.o strerror.o mbed_stub.o
 APPL_BINOBJS := httpd_fs.o
 APPL_CFLAGS := $(APPL_CFLAGS)
@@ -214,5 +228,4 @@
 endif
 
-TINETDIR = tinet
 ifdef TINETDIR
 	#
@@ -250,11 +263,27 @@
 #  ã·ã¹ãã ãµã¼ãã¹ã«é¢ããå®ç¾©
 #
+ifdef TCINSTALL
+GCC_PATH = $(TCINSTALL)
+else
+GCC_PATH = $(shell which $(CC))/../../
+endif
+MALLOC_LIB = "${GCC_PATH}arm-none-eabi/lib/thumb/v7-ar/fpv3/hard/libc.a"
+MALLOC_OBJS = lib_a-reent.o lib_a-impure.o lib_a-malloc.o lib_a-mallocr.o lib_a-calloc.o lib_a-callocr.o lib_a-realloc.o lib_a-reallocr.o lib_a-sbrkr.o lib_a-freer.o
+
 SYSSVC_DIRS := $(TECSGENDIR) $(SRCDIR)/tecs_kernel \
 				$(SYSSVC_DIRS) $(SRCDIR)/syssvc
 SYSSVC_ASMOBJS := $(SYSSVC_ASMOBJS)
-SYSSVC_COBJS := $(INIT_TECS_COBJ) $(TECS_COBJS) $(SYSSVC_COBJS) \
-				 $(CXXRTS)
+SYSSVC_COBJS := $(SYSSVC_COBJS) $(TECS_COBJS) \
+				$(INIT_TECS_COBJ) $(CXXRTS)
 SYSSVC_CFLAGS := $(SYSSVC_CFLAGS)
-INCLUDES := $(INCLUDES) -I$(TECSGENDIR) -I$(SRCDIR)/tecs_kernel
+INCLUDES := $(INCLUDES) -I$(TECSGENDIR) -I$(SRCDIR)/tecs_kernel -I../../musl-1.1.18/include
+
+#
+#  ãã¬ã¼ã¹ã­ã°è¨é²ã®ãµã³ãã«ã³ã¼ãã«é¢ããå®ç¾©
+#
+ifdef ENABLE_TRACE
+	COPTS := $(COPTS) -DTOPPERS_ENABLE_TRACE
+	SYSSVC_DIRS := $(SYSSVC_DIRS) $(SRCDIR)/arch/tracelog
+endif
 
 #
@@ -263,5 +292,5 @@
 .PHONY: all
 ifndef OMIT_TECS
-all: tecs
+all: tecs | $(DEPDIR)
 #	@$(MAKE) check
 	@$(MAKE) check $(OBJNAME).bin
@@ -279,4 +308,5 @@
 #  ã³ã³ãã£ã®ã¥ã¬ã¼ã¿ã«é¢ããå®ç¾©
 #
+CFG_KERNEL := --kernel asp
 ifndef TINETDIR
   CFG_TRB := -T $(TARGETDIR)/target_kernel.trb
@@ -287,12 +317,12 @@
   CFG_TABS := --api-table $(TINET_ROOT)/tcpip_api.def:tcpip \
 			--api-table $(SRCDIR)/kernel/kernel_api.def:kernel \
-			--symval-table $(SRCDIR)/tinet/tcpip_sym.def \
+			--symval-table $(TINET_ROOT)/tcpip_sym.def \
 			--symval-table $(SRCDIR)/kernel/kernel_sym.def $(CFG_TABS)
 endif
 CFG_ASMOBJS := $(CFG_ASMOBJS)
 CFG_COBJS := kernel_cfg.o $(CFG_COBJS)
-CFG_OBJS := $(CFG_ASMOBJS) $(CFG_COBJS)
+CFG_CFLAGS := -DTOPPERS_CB_TYPE_ONLY $(CFG_CFLAGS)
+
 CFG2_OUT_SRCS := kernel_cfg.h kernel_cfg.c $(CFG2_OUT_SRCS)
-CFG_CFLAGS := -DTOPPERS_CB_TYPE_ONLY $(CFG_CFLAGS)
 
 #
@@ -325,7 +355,5 @@
 					$(foreach file,$(KERNEL_FCSRCS),$(file:.c=.o))
 endif
-ifdef OMIT_OFFSET_H
-	OFFSET_H =
-else
+ifdef TARGET_OFFSET_TRB
 	OFFSET_H = offset.h
 endif
@@ -343,5 +371,5 @@
 endif
 ifndef TARGET_TCPIP_TRB
-	TARGET_TCPIP_TRB := $(SRCDIR)/tinet/tinet.trb
+	TARGET_TCPIP_TRB := $(SRCDIR)/$(TINETDIR)/tinet.trb
 endif
 
@@ -356,9 +384,27 @@
 
 #
+#  ä¸­éãªãã¸ã§ã¯ããã¡ã¤ã«ãç½®ããã£ã¬ã¯ããªã®å¦ç
+#
+APPL_ASMOBJS   := $(addprefix $(OBJDIR)/, $(APPL_ASMOBJS))
+APPL_CXXOBJS   := $(addprefix $(OBJDIR)/, $(APPL_CXXOBJS))
+APPL_COBJS     := $(addprefix $(OBJDIR)/, $(APPL_COBJS))
+APPL_BINOBJS   := $(addprefix $(OBJDIR)/, $(APPL_BINOBJS))
+SYSSVC_ASMOBJS := $(addprefix $(OBJDIR)/, $(SYSSVC_ASMOBJS))
+SYSSVC_COBJS   := $(addprefix $(OBJDIR)/, $(SYSSVC_COBJS))
+KERNEL_ASMOBJS := $(addprefix $(OBJDIR)/, $(KERNEL_ASMOBJS))
+KERNEL_COBJS   := $(addprefix $(OBJDIR)/, $(KERNEL_COBJS))
+KERNEL_LCOBJS  := $(addprefix $(OBJDIR)/, $(KERNEL_LCOBJS))
+CFG_ASMOBJS    := $(addprefix $(OBJDIR)/, $(CFG_ASMOBJS))
+CFG_COBJS      := $(addprefix $(OBJDIR)/, $(CFG_COBJS))
+CFG_DMY        := $(addprefix $(OBJDIR)/, $(CFG_DMY))
+MALLOC_OBJS    := $(addprefix $(OBJDIR)/, $(MALLOC_OBJS))
+
+#
 #  ã³ã³ãã¤ã«ã®ããã®å¤æ°ã®å®ç¾©
 #
-KERNEL_LIB_OBJS = $(KERNEL_ASMOBJS) $(KERNEL_COBJS) $(KERNEL_LCOBJS)
+APPL_OBJS = $(APPL_ASMOBJS) $(APPL_COBJS) $(APPL_CXXOBJS) $(APPL_BINOBJS)
 SYSSVC_OBJS = $(SYSSVC_ASMOBJS) $(SYSSVC_COBJS) $(HIDDEN_OBJS)
-APPL_OBJS = $(APPL_ASMOBJS) $(APPL_COBJS) $(APPL_CXXOBJS) $(APPL_BINOBJS)
+KERNEL_LIB_OBJS = $(KERNEL_ASMOBJS) $(KERNEL_COBJS) $(KERNEL_LCOBJS) $(MALLOC_OBJS)
+CFG_OBJS = $(CFG_ASMOBJS) $(CFG_COBJS)
 ALL_OBJS = $(START_OBJS) $(APPL_OBJS) $(SYSSVC_OBJS) $(CFG_OBJS) \
 											$(END_OBJS) $(HIDDEN_OBJS)
@@ -372,4 +418,12 @@
 	OBJ_LDFLAGS := $(OBJ_LDFLAGS) -L.
 endif
+ifdef SYSSVC_LIB
+	LIBS_DEP := $(LIBS_DEP) $(SYSSVC_LIB)/libsyssvc.a
+	OBJ_LDFLAGS := $(OBJ_LDFLAGS) -L$(SYSSVC_LIB)
+	REALCLEAN_FILES := $(REALCLEAN_FILES) libsyssvc.a
+else
+	LIBS_DEP := $(LIBS_DEP) libsyssvc.a
+	OBJ_LDFLAGS := $(OBJ_LDFLAGS) -L.
+endif
 
 ifdef TEXT_START_ADDRESS
@@ -394,5 +448,5 @@
 tecs $(TECSGEN_SRCS) $(TECS_HEADERS): $(TECSGEN_TIMESTAMP) ;
 $(TECSGEN_TIMESTAMP): $(APPL_CDL) $(TECS_IMPORTS)
-	$(TECSGEN) $< -R $(INCLUDES) --cpp "$(TECS_CPP)" -g $(TECSGENDIR)
+	$(TECSGEN) $< -R $(INCLUDES) --cpp "$(subst ", \", $(TECS_CPP))" -g $(TECSGENDIR)
 
 #
@@ -401,11 +455,10 @@
 cfg1_out.c cfg1_out.db: cfg1_out.timestamp ;
 cfg1_out.timestamp: $(APPL_CFG) $(TECSGEN_TIMESTAMP)
-	echo $(CFG_TABS)
-	$(CFG) --pass 1 --kernel asp $(INCLUDES) $(CFG_TABS) \
+	$(CFG) --pass 1 $(CFG_KERNEL) $(INCLUDES) $(CFG_TABS) \
 						-M $(DEPDIR)/cfg1_out_c.d $(TARGET_KERNEL_CFG) $<
 
-$(CFG1_OUT): $(START_OBJS) cfg1_out.o $(CFG_DMY) $(END_OBJS) $(HIDDEN_OBJS)
+$(CFG1_OUT): $(START_OBJS) $(OBJDIR)/cfg1_out.o $(CFG_DMY) $(END_OBJS) $(HIDDEN_OBJS)
 	$(LINK) $(CFLAGS) $(LDFLAGS) $(CFG1_OUT_LDFLAGS) -o $(CFG1_OUT) \
-						$(START_OBJS) cfg1_out.o $(CFG_DMY) $(END_OBJS)
+						$(START_OBJS) $(OBJDIR)/cfg1_out.o $(CFG_DMY) $(LIBS) $(END_OBJS) $(HIDDEN_OBJS)
 
 cfg1_out.syms: $(CFG1_OUT)
@@ -417,5 +470,5 @@
 $(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) $(CFG_TRB)
+	$(CFG) --pass 2 $(CFG_KERNEL) $(INCLUDES) $(CFG_TRB)
 
 #
@@ -424,5 +477,5 @@
 $(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) \
+	$(CFG) --pass 2 -O $(CFG_KERNEL) $(INCLUDES) -T $(TARGET_OFFSET_TRB) \
 				--rom-symbol cfg1_out.syms --rom-image cfg1_out.srec
 
@@ -436,7 +489,23 @@
 
 #
+#  ã·ã¹ãã ãµã¼ãã¹ã³ã¼ã«ã©ã¤ãã©ãªãã¡ã¤ã«ã®çæ
+#
+libsyssvc.a: $(filter-out $(OBJDIR)/tBannerMain.o, $(SYSSVC_OBJS))
+	rm -f libsyssvc.a
+	$(AR) -rcs libsyssvc.a $(filter-out $(OBJDIR)/tBannerMain.o, $(SYSSVC_OBJS))
+	$(RANLIB) libsyssvc.a
+
+#
+#  ä¸¦åmakeã®ããã®ä¾å­é¢ä¿ã®å®ç¾©
+#
+$(APPL_OBJS) $(filter-out $(CFG_DMY), $(SYSSVC_OBJS)): | kernel_cfg.timestamp
+$(APPL_ASMOBJS) $(filter-out $(CFG_DMY), $(SYSSVC_ASMOBJS)) $(KERNEL_ASMOBJS) $(CFG_ASMOBJS): \
+														| offset.timestamp
+
+#
 #  ç¹å¥ãªä¾å­é¢ä¿ã®å®ç¾©
 #
-tBannerMain.o: $(filter-out tBannerMain.o,$(ALL_OBJS)) $(LIBS_DEP)
+$(OBJDIR)/tBannerMain.o: $(filter-out $(OBJDIR)/tBannerMain.o,$(ALL_OBJS)) \
+																$(LIBS_DEP)
 
 #
@@ -448,5 +517,11 @@
 			-Wl,-Map=$(OBJNAME).map,--cref -Wl,--gc-sections -Wl,-e_kernel__start,--gc-keep-exported=_kernel_istk \
 			$(START_OBJS) $(APPL_OBJS) $(SYSSVC_OBJS) $(CFG_OBJS) \
-			$(ALL_LIBS) $(END_OBJS)
+			-Wl,--start-group $(ALL_LIBS) -Wl,--end-group $(END_OBJS)
+
+#
+#  ä¾å­é¢ä¿ãã©ã«ãã®ä½æ
+#
+$(DEPDIR):
+	mkdir $@
 
 #
@@ -476,5 +551,5 @@
 check: check.timestamp ;
 check.timestamp: cfg2_out.db $(OBJNAME).syms $(OBJNAME).srec
-	$(CFG) --pass 3 --kernel asp -O $(INCLUDES) -T $(TARGET_CHECK_TRB) \
+	$(CFG) --pass 3 $(CFG_KERNEL) -O $(INCLUDES) -T $(TARGET_CHECK_TRB) \
 				--rom-symbol $(OBJNAME).syms --rom-image $(OBJNAME).srec
 	@echo "configuration check passed"
@@ -485,5 +560,5 @@
 .PHONY: clean
 clean:
-	rm -f \#* *~ *.o $(DEPDIR)/*.d $(CLEAN_FILES) check.timestamp
+	rm -f \#* *~ $(OBJDIR)/*.o $(DEPDIR)/*.d $(CLEAN_FILES) check.timestamp
 	rm -f $(OBJFILE) $(OBJNAME).syms $(OBJNAME).srec $(OBJNAME).bin
 	rm -f kernel_cfg.timestamp $(CFG2_OUT_SRCS) cfg2_out.db
@@ -495,9 +570,18 @@
 	rm -f libkernel.a
 endif
+ifndef SYSSVC_LIB
+	rm -f libsyssvc.a
+endif
+	rm -f $(MALLOC_OBJS)
 
 .PHONY: cleankernel
 cleankernel:
 	rm -f $(OFFSET_H) $(KERNEL_LIB_OBJS)
-	rm -f $(KERNEL_LIB_OBJS:%.o=$(DEPDIR)/%.d)
+	rm -f $(KERNEL_LIB_OBJS:$(OBJDIR)/%.o=$(DEPDIR)/%.d)
+
+.PHONY: cleansyssvc
+cleansyssvc:
+	rm -f $(SYSSVC_OBJS)
+	rm -f $(SYSSVC_OBJS:$(OBJDIR)/%.o=$(DEPDIR)/%.d)
 
 .PHONY: realclean
@@ -512,15 +596,15 @@
 #  ã®ã¿ãä»ãã¦ã³ã³ãã¤ã«ããï¼
 #
-ALL_CFG_COBJS = $(CFG_COBJS) cfg1_out.o
+ALL_CFG_COBJS = $(CFG_COBJS) $(OBJDIR)/cfg1_out.o
 ALL_CFG_ASMOBJS = $(CFG_ASMOBJS)
 
-$(ALL_CFG_COBJS): %.o: %.c
-	$(CC) -c -MD -MP -MF $(DEPDIR)/$*.d $(CFLAGS) $(CFG_CFLAGS) $<
-
-$(ALL_CFG_COBJS:.o=.s): %.s: %.c
-	$(CC) -S $(CFLAGS) $(CFG_CFLAGS) $<
-
-$(ALL_CFG_ASMOBJS): %.o: %.S
-	$(CC) -c -MD -MP -MF $(DEPDIR)/$*.d $(CFLAGS) $(CFG_CFLAGS) $<
+$(ALL_CFG_COBJS): $(OBJDIR)/%.o: %.c
+	$(CC) -c -o $@ -MD -MP -MF $(DEPDIR)/$*.d $(CFLAGS) $(CFG_CFLAGS) $<
+
+$(ALL_CFG_COBJS:$(OBJDIR)/%.o=%.s): %.s: %.c
+	$(CC) -S -o $@ $(CFLAGS) $(CFG_CFLAGS) $<
+
+$(ALL_CFG_ASMOBJS): $(OBJDIR)/%.o: %.S
+	$(CC) -c -o $@ -MD -MP -MF $(DEPDIR)/$*.d $(CFLAGS) $(CFG_CFLAGS) $<
 
 #
@@ -574,67 +658,71 @@
 #  ã³ã³ãã¤ã«ã«ã¼ã«ã®å®ç¾©
 #
-$(KERNEL_COBJS): %.o: %.c
-	$(CC) -c -MD -MP -MF $(DEPDIR)/$*.d $(CFLAGS) $(KERNEL_CFLAGS) $<
-
-$(KERNEL_COBJS:.o=.s): %.s: %.c
-	$(CC) -S $(CFLAGS) $(KERNEL_CFLAGS) $<
-
-$(KERNEL_LCOBJS): %.o:
-	$(CC) -DTOPPERS_$(*F) -o $@ -c -MD -MP -MF $(DEPDIR)/$*.d \
+$(KERNEL_COBJS): $(OBJDIR)/%.o: %.c
+	$(CC) -c -o $@ -MD -MP -MF $(DEPDIR)/$*.d $(CFLAGS) $(KERNEL_CFLAGS) $<
+
+$(KERNEL_COBJS:$(OBJDIR)/%.o=%.s): %.s: %.c
+	$(CC) -S -o $@ $(CFLAGS) $(KERNEL_CFLAGS) $<
+
+$(KERNEL_LCOBJS): $(OBJDIR)/%.o:
+	$(CC) -c -o $@ -DTOPPERS_$(*F) -MD -MP -MF $(DEPDIR)/$*.d \
 									$(CFLAGS) $(KERNEL_CFLAGS) $<
 
-$(KERNEL_LCOBJS:.o=.s): %.s:
-	$(CC) -DTOPPERS_$(*F) -o $@ -S $(CFLAGS) $(KERNEL_CFLAGS) $<
-
-$(KERNEL_ASMOBJS): %.o: %.S
-	$(CC) -c -MD -MP -MF $(DEPDIR)/$*.d $(CFLAGS) $(KERNEL_CFLAGS) $<
-
-$(SYSSVC_COBJS): %.o: %.c
-	$(CC) -c -MD -MP -MF $(DEPDIR)/$*.d $(CFLAGS) $(SYSSVC_CFLAGS) $<
-
-$(SYSSVC_COBJS:.o=.s): %.s: %.c
-	$(CC) -S $(CFLAGS) $(SYSSVC_CFLAGS) $<
-
-$(SYSSVC_ASMOBJS): %.o: %.S
-	$(CC) -c -MD -MP -MF $(DEPDIR)/$*.d $(CFLAGS) $(SYSSVC_CFLAGS) $<
-
-$(APPL_COBJS): %.o: %.c
-	$(CC) -c -MD -MP -MF $(DEPDIR)/$*.d $(CFLAGS) $(APPL_CFLAGS) $<
-
-$(APPL_COBJS:.o=.s): %.s: %.c
-	$(CC) -S $(CFLAGS) $(APPL_CFLAGS) $<
-
-$(APPL_CXXOBJS): %.o: %.cpp
-	$(CXX) -c -MD -MP -MF $(DEPDIR)/$*.d $(CFLAGS) $(APPL_CFLAGS) $<
-
-$(APPL_CXXOBJS:.o=.s): %.s: %.cpp
-	$(CXX) -S $(CFLAGS) $(APPL_CFLAGS) $<
-
-$(APPL_ASMOBJS): %.o: %.S
-	$(CC) -c -MD -MP -MF $(DEPDIR)/$*.d $(CFLAGS) $(APPL_CFLAGS) $<
-
-$(APPL_BINOBJS): %.o: %.bin
-	$(OBJCOPY) -B arm -I binary -O elf32-littlearm --rename-section .data=.rodata $< $*.o
+$(KERNEL_LCOBJS:$(OBJDIR)/%.o=%.s): %.s:
+	$(CC) -S -o $@ -DTOPPERS_$(*F) $(CFLAGS) $(KERNEL_CFLAGS) $<
+
+$(KERNEL_ASMOBJS): $(OBJDIR)/%.o: %.S
+	$(CC) -c -o $@ -MD -MP -MF $(DEPDIR)/$*.d $(CFLAGS) $(KERNEL_CFLAGS) $<
+
+$(SYSSVC_COBJS): $(OBJDIR)/%.o: %.c
+	$(CC) -c -o $@ -MD -MP -MF $(DEPDIR)/$*.d $(CFLAGS) $(SYSSVC_CFLAGS) $<
+
+$(SYSSVC_COBJS:$(OBJDIR)/%.o=%.s): %.s: %.c
+	$(CC) -S -o $@ $(CFLAGS) $(SYSSVC_CFLAGS) $<
+
+$(SYSSVC_ASMOBJS): $(OBJDIR)/%.o: %.S
+	$(CC) -c -o $@ -MD -MP -MF $(DEPDIR)/$*.d $(CFLAGS) $(SYSSVC_CFLAGS) $<
+
+$(APPL_COBJS): $(OBJDIR)/%.o: %.c
+	$(CC) -c -o $@ -MD -MP -MF $(DEPDIR)/$*.d $(CFLAGS) $(APPL_CFLAGS) $<
+
+$(APPL_COBJS:$(OBJDIR)/%.o=%.s): %.s: %.c
+	$(CC) -S -o $@ $(CFLAGS) $(APPL_CFLAGS) $<
+
+$(APPL_CXXOBJS): $(OBJDIR)/%.o: %.cpp
+	$(CXX) -c -o $@ -MD -MP -MF $(DEPDIR)/$*.d $(CFLAGS) $(APPL_CFLAGS) $<
+
+$(APPL_CXXOBJS:$(OBJDIR)/%.o=%.s): %.s: %.cpp
+	$(CXX) -S -o $@ $(CFLAGS) $(APPL_CFLAGS) $<
+
+$(APPL_ASMOBJS): $(OBJDIR)/%.o: %.S
+	$(CC) -c -o $@ -MD -MP -MF $(DEPDIR)/$*.d $(CFLAGS) $(APPL_CFLAGS) $<
+
+$(APPL_BINOBJS): $(OBJDIR)/%.o: %.bin
+	$(OBJCOPY) -B arm -I binary -O elf32-littlearm --rename-section .data=.rodata $< $(OBJDIR)/$*.o
+
+$(MALLOC_OBJS): $(OBJDIR)/%.o:
+	$(AR) x $(MALLOC_LIB) $(notdir $@)
+	mv $(notdir $@) $@
 
 #
 #  ããã©ã«ãã³ã³ãã¤ã«ã«ã¼ã«ãä¸æ¸ã
 #
-%.o: %.c
+$(OBJDIR)/%.o: %.c
 	@echo "*** Default compile rules should not be used."
-	$(CC) -c -MD -MP -MF $(DEPDIR)/$*.d $(CFLAGS) $<
+	$(CC) -c -o $@ -MD -MP -MF $(DEPDIR)/$*.d $(CFLAGS) $<
 
 %.s: %.c
 	@echo "*** Default compile rules should not be used."
-	$(CC) -S $(CFLAGS) $<
-
-%.o: %.cpp
+	$(CC) -S -o $@ $(CFLAGS) $<
+
+$(OBJDIR)/%.o: %.cpp
 	@echo "*** Default compile rules should not be used."
-	$(CXX) -c -MD -MP -MF $(DEPDIR)/$*.d $(CFLAGS) $<
+	$(CXX) -c -o $@ -MD -MP -MF $(DEPDIR)/$*.d $(CFLAGS) $<
 
 %.s: %.cpp
 	@echo "*** Default compile rules should not be used."
-	$(CXX) -S $(CFLAGS) $<
-
-%.o: %.S
+	$(CXX) -S -o $@ $(CFLAGS) $<
+
+$(OBJDIR)/%.o: %.S
 	@echo "*** Default compile rules should not be used."
-	$(CC) -c -MD -MP -MF $(DEPDIR)/$*.d $(CFLAGS) $<
+	$(CC) -c -o $@ -MD -MP -MF $(DEPDIR)/$*.d $(CFLAGS) $<
Index: EcnlProtoTool/trunk/ntshell/fatfs/sdfs.c
===================================================================
--- EcnlProtoTool/trunk/ntshell/fatfs/sdfs.c	(revision 427)
+++ EcnlProtoTool/trunk/ntshell/fatfs/sdfs.c	(revision 429)
@@ -116,5 +116,5 @@
 #include "sdfs.h"
 //#include "mbed_debug.h"
-#include "wait_api.h"
+#include "mbed_wait_api.h"
 
 #define debug(str, ...)
Index: EcnlProtoTool/trunk/ntshell/src/mbedcall.c
===================================================================
--- EcnlProtoTool/trunk/ntshell/src/mbedcall.c	(revision 427)
+++ EcnlProtoTool/trunk/ntshell/src/mbedcall.c	(revision 429)
@@ -59,5 +59,5 @@
 #include "serial_api.h"
 #include "us_ticker_api.h"
-#include "wait_api.h"
+#include "mbed_wait_api.h"
 #include "../../mbed_api/src/mbedcall.h"
 
Index: EcnlProtoTool/trunk/ntshell/src/syscall.c
===================================================================
--- EcnlProtoTool/trunk/ntshell/src/syscall.c	(revision 427)
+++ EcnlProtoTool/trunk/ntshell/src/syscall.c	(revision 429)
@@ -61,27 +61,28 @@
 // https://os.mbed.com/users/dkato/code/FlashAccess/#652a093cf264
 void flash_access_cache_control(void) {
-    unsigned int assoc;
-
-    /* ==== Cleaning and invalidation of the L1 data cache ==== */
-    __v7_all_cache(2);
-    __DSB();
-
-    /* ==== Cleaning and invalidation of the L2 cache ==== */
-    if (PL310->AUX_CNT & (1<<16)) {
-        assoc = 16;
-    } else {
-        assoc =  8;
-    }
-    PL310->INV_WAY = (1 << assoc) - 1;
-    while(PL310->INV_WAY & ((1 << assoc) - 1)); // poll invalidate
-    PL310->CACHE_SYNC = 0x0;
-
-    /* ==== Invalidate all TLB entries ==== */
-    __ca9u_inv_tlb_all();
-
-    /* ==== Invalidate the L1 instruction cache ==== */
-    __v7_inv_icache_all();
-    __DSB();
-    __ISB();
+	unsigned int assoc;
+
+	/* ==== Cleaning and invalidation of the L1 data cache ==== */
+	L1C_CleanInvalidateDCacheAll();
+	__DSB();
+
+	/* ==== Cleaning and invalidation of the L2 cache ==== */
+	if (L2C_310->AUX_CNT & (1 << 16)) {
+		assoc = 16;
+	}
+	else {
+		assoc = 8;
+	}
+	L2C_310->INV_WAY = (1 << assoc) - 1;
+	while (L2C_310->INV_WAY & ((1 << assoc) - 1)); // poll invalidate
+	L2C_310->CACHE_SYNC = 0x0;
+
+	/* ==== Invalidate all TLB entries ==== */
+	MMU_InvalidateTLB();
+
+	/* ==== Invalidate the L1 instruction cache ==== */
+	L1C_InvalidateICacheAll();
+	__DSB();
+	__ISB();
 }
 
Index: EcnlProtoTool/trunk/ntshell/src/tinet_main.cfg
===================================================================
--- EcnlProtoTool/trunk/ntshell/src/tinet_main.cfg	(revision 427)
+++ EcnlProtoTool/trunk/ntshell/src/tinet_main.cfg	(revision 429)
@@ -43,6 +43,4 @@
 #include "main.h"
 
-INCLUDE("netinet/ip_igmp.cfg");
-
 /* DHCP クライアント */
 /*INCLUDE("netapp/tinet_dhcp4_cli.cfg");*/
