diff options
Diffstat (limited to 'apps/examples')
-rw-r--r-- | apps/examples/hello/Makefile | 45 | ||||
-rw-r--r-- | apps/examples/nsh/Makefile | 14 |
2 files changed, 37 insertions, 22 deletions
diff --git a/apps/examples/hello/Makefile b/apps/examples/hello/Makefile index 2cacfb139..61eba2808 100644 --- a/apps/examples/hello/Makefile +++ b/apps/examples/hello/Makefile @@ -39,36 +39,45 @@ include $(APPDIR)/Make.defs # Hello, World! built-in application info -APPNAME = hello -PRIORITY = SCHED_PRIORITY_DEFAULT -STACKSIZE = 2048 +APPNAME = hello +PRIORITY = SCHED_PRIORITY_DEFAULT +STACKSIZE = 2048 # Hello, World! Example -ASRCS = -CSRCS = hello_main.c +ASRCS = +CSRCS = hello_main.c -AOBJS = $(ASRCS:.S=$(OBJEXT)) -COBJS = $(CSRCS:.c=$(OBJEXT)) +AOBJS = $(ASRCS:.S=$(OBJEXT)) +COBJS = $(CSRCS:.c=$(OBJEXT)) -SRCS = $(ASRCS) $(CSRCS) -OBJS = $(AOBJS) $(COBJS) +SRCS = $(ASRCS) $(CSRCS) +OBJS = $(AOBJS) $(COBJS) ifeq ($(CONFIG_WINDOWS_NATIVE),y) - BIN = ..\..\libapps$(LIBEXT) + BIN = ..\..\libapps$(LIBEXT) else ifeq ($(WINTOOL),y) - BIN = ..\\..\\libapps$(LIBEXT) + BIN = ..\\..\\libapps$(LIBEXT) else - BIN = ../../libapps$(LIBEXT) + BIN = ../../libapps$(LIBEXT) endif endif -ROOTDEPPATH = --dep-path . +ifeq ($(WINTOOL),y) + INSTALL_DIR = "${shell cygpath -w $(BIN_DIR)}" +else + INSTALL_DIR = $(BIN_DIR) +endif + +CONFIG_EXAMPLES_HELLO_PROGNAME ?= hello$(EXEEXT) +PROGNAME = $(CONFIG_EXAMPLES_HELLO_PROGNAME) + +ROOTDEPPATH = --dep-path . # Common build -VPATH = +VPATH = all: .built .PHONY: clean depend distclean @@ -84,11 +93,11 @@ $(COBJS): %$(OBJEXT): %.c @touch .built ifeq ($(CONFIG_BUILD_KERNEL),y) -$(INSTALL_DIR)/$(PROGNAME): $(OBJS) - @echo "LD: $<" - $(Q) $(LD) $(LDELFFLAGS) $(LDLIBPATH) -o $@ $(ARCHCRT0OBJ) $^ $(LDLIBS) +$(BIN_DIR)$(DELIM)$(PROGNAME): $(OBJS) + @echo "LD: $(PROGNAME)" + $(Q) $(LD) $(LDELFFLAGS) $(LDLIBPATH) -o $(INSTALL_DIR)$(DELIM)$(PROGNAME) $(ARCHCRT0OBJ) $(LDLIBS) -install: $(INSTALL_DIR)/$(PROGNAME) +install: $(BIN_DIR)/$(PROGNAME) else install: diff --git a/apps/examples/nsh/Makefile b/apps/examples/nsh/Makefile index 40b8c8561..843a15be7 100644 --- a/apps/examples/nsh/Makefile +++ b/apps/examples/nsh/Makefile @@ -58,6 +58,12 @@ else endif endif +ifeq ($(WINTOOL),y) + INSTALL_DIR = "${shell cygpath -w $(BIN_DIR)}" +else + INSTALL_DIR = $(BIN_DIR) +endif + CONFIG_EXAMPLES_NSH_PROGNAME ?= nsh$(EXEEXT) PROGNAME = $(CONFIG_EXAMPLES_NSH_PROGNAME) @@ -81,11 +87,11 @@ $(COBJS): %$(OBJEXT): %.c @touch .built ifeq ($(CONFIG_BUILD_KERNEL),y) -$(INSTALL_DIR)/$(PROGNAME): $(OBJS) - @echo "LD: $<" - $(Q) $(LD) $(LDELFFLAGS) $(LDLIBPATH) -o $@ $(ARCHCRT0OBJ) $^ $(LDLIBS) +$(BIN_DIR)$(DELIM)$(PROGNAME): $(OBJS) + @echo "LD: $(PROGNAME)" + $(Q) $(LD) $(LDELFFLAGS) $(LDLIBPATH) -o $(INSTALL_DIR)$(DELIM)$(PROGNAME) $(ARCHCRT0OBJ) $(LDLIBS) -install: $(INSTALL_DIR)/$(PROGNAME) +install: $(BIN_DIR)/$(PROGNAME) else install: |