9
0
Fork 0

Move nuttx/examples to apps/examples

git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@3405 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
patacongo 2011-03-20 18:18:19 +00:00
parent f68c474e8a
commit eafaeb9398
377 changed files with 5758 additions and 2729 deletions

View File

@ -36,10 +36,6 @@
-include $(TOPDIR)/Make.defs
ifeq ($(WINTOOL),y)
INCDIROPT = -w
endif
APPDIR = ${shell pwd}
# Application Directories
@ -47,7 +43,7 @@ APPDIR = ${shell pwd}
# SUBDIRS is the list of all directories containing Makefiles. It is used
# only for cleaning.
SUBDIRS = nshlib netutils vsn
SUBDIRS = nshlib netutils examples vsn
# we use a non-existing .built_always to guarantee that Makefile
# always walks into the sub-directories and asks for build
@ -93,7 +89,8 @@ $(foreach BUILT, $(AVAILABLE_APPS), $(eval $(call BUILTIN_ADD_BUILT,$(BUILT))))
endif
ROOTDEPPATH = --dep-path .
# Source and object files
ASRCS =
CSRCS = exec_nuttapp.c
@ -105,9 +102,11 @@ OBJS = $(AOBJS) $(COBJS)
BIN = libapps$(LIBEXT)
ROOTDEPPATH = --dep-path .
VPATH =
all: $(BIN)
.PHONY: .depend depend clean distclean
$(AOBJS): %$(OBJEXT): %.S
$(call ASSEMBLE, $<, $@)
@ -138,21 +137,21 @@ $(BIN): $(OBJS) $(BUILTIN_APPS_BUILT)
depend: .depend
define MAKECLEAN
@(MAKE) -C $1 $2 TOPDIR="$(TOPDIR)" APPDIR=$(APPDIR)
endef
clean:
@rm -f $(BIN) *~ .*.swp *.o libapps.a
$(call CLEAN)
$(foreach DIR, $(SUBDIRS), $(eval $(call MAKECLEAN,$(DIR),clean)))
@for dir in $(SUBDIRS) ; do \
$(MAKE) -C $$dir clean TOPDIR="$(TOPDIR)" APPDIR=$(APPDIR); \
done
distclean: clean
@rm -f .config
@rm -f Make.dep .depend
@rm -f exec_nuttapp_list.h
@rm -f exec_nuttapp_proto.h
$(foreach DIR, $(SUBDIRS), $(eval $(call MAKECLEAN,$(DIR),distclean)))
@for dir in $(SUBDIRS) ; do \
$(MAKE) -C $$dir distclean TOPDIR="$(TOPDIR)" APPDIR=$(APPDIR); \
done
-include Make.dep

View File

@ -1,7 +1,7 @@
############################################################################
# examples/hello/Makefile
# apps/examples/Makefile
#
# Copyright (C) 2008, 2010 Gregory Nutt. All rights reserved.
# Copyright (C) 2011 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt <spudmonkey@racsa.co.cr>
#
# Redistribution and use in source and binary forms, with or without
@ -33,43 +33,33 @@
#
############################################################################
-include $(TOPDIR)/.config
-include $(TOPDIR)/Make.defs
-include $(TOPDIR)/.config # Current configuration
ASRCS =
AOBJS = $(ASRCS:.S=$(OBJEXT))
CSRCS = main.c
COBJS = $(CSRCS:.c=$(OBJEXT))
# Sub-directories
SRCS = $(ASRCS) $(CSRCS)
OBJS = $(AOBJS) $(COBJS)
SUBDIRS = dhcpd hello helloxx hidkbd igmp mm mount nettest nsh null nx \
nxflat ostest pashello pipe poll romfs sendmail serloop thttpd \
udp uip usbserial usbstorage wget wlan
BIN = libapp$(LIBEXT)
all: nothing
.PHONY: nothing depend clean distclean
all: $(BIN)
nothing:
$(AOBJS): %$(OBJEXT): %.S
$(call ASSEMBLE, $<, $@)
$(COBJS): %$(OBJEXT): %.c
$(call COMPILE, $<, $@)
$(BIN): $(OBJS)
@( for obj in $(OBJS) ; do \
$(call ARCHIVE, $@, $${obj}); \
done ; )
.depend: Makefile $(SRCS)
@$(MKDEP) $(CC) -- $(CFLAGS) -- $(SRCS) >Make.dep
@touch $@
depend: .depend
depend:
@for dir in $(SUBDIRS) ; do \
$(MAKE) -C $$dir depend TOPDIR="$(TOPDIR)" APPDIR=$(APPDIR); \
done
clean:
@rm -f $(BIN) *~ .*.swp
$(call CLEAN)
@for dir in $(SUBDIRS) ; do \
$(MAKE) -C $$dir clean TOPDIR="$(TOPDIR)" APPDIR=$(APPDIR); \
done
distclean: clean
@rm -f Make.dep .depend
@for dir in $(SUBDIRS) ; do \
$(MAKE) -C $$dir distclean TOPDIR="$(TOPDIR)" APPDIR=$(APPDIR); \
done
-include Make.dep

View File

@ -3,12 +3,12 @@ examples
The examples directory contains several sample applications that
can be linked with NuttX. The specific example is selected in the
configs/<board-name>/defconfig file via the CONFIG_APP_DIR setting.
configs/<board-name>/appconfig file via the CONFIGURED_APPS setting.
This setting provides the path to the directory containing the
application Makefile (this path is a relative to the NuttX top-
application Makefile (this path is a relative to the apps/ top-
level directory). For example,
CONFIG_APP_DIR=examples/ostest
CONFIGURE_APPS += examples/ostest=.built_always
Selects the examples/ostest example.
@ -21,7 +21,7 @@ examples/dhcpd
host-based DHCPD server. This can be built as follows:
cd examples/dhcpd
make -f Makefile.host
make -f Makefile.host TOPDIR=<nuttx-directory>
NuttX configuration settings:
@ -310,7 +310,7 @@ examples/poll
Linux or Cygwin as follows:
cd examples/usbserial
make -f Makefile.host TOPDIR=../../. TARGETIP=<target-ip>
make -f Makefile.host TOPDIR=<nuttx-directory> TARGETIP=<target-ip>
Where <target-ip> is the IP address of your target board.
@ -358,7 +358,7 @@ examples/sendmail
the Cygwin/Linux host environment:
cd examples/sendmail
make -f Makefile.host
make -f Makefile.host TOPDIR=<nuttx-directory>
Settings unique to this example include:
@ -514,7 +514,7 @@ examples/usbserial
as follows:
cd examples/usbserial
make -f Makefile.host TOPDIR=../../.
make -f Makefile.host TOPDIR=<nuttx-directory>
RUNNING THE TEST

View File

@ -1,7 +1,7 @@
############################################################################
# examples/nxflat/Makefile
# apps/examples/dhcpd/Makefile
#
# Copyright (C) 2009-2010 Gregory Nutt. All rights reserved.
# Copyright (C) 2009-2011 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt <spudmonkey@racsa.co.cr>
#
# Redistribution and use in source and binary forms, with or without
@ -35,24 +35,29 @@
-include $(TOPDIR)/.config
-include $(TOPDIR)/Make.defs
include $(APPDIR)/Make.defs
ASRCS =
AOBJS = $(ASRCS:.S=$(OBJEXT))
# DHCP Daemon Example
CSRCS = nx_main.c nx_events.c nx_kbdin.c
ifeq ($(CONFIG_NX_MULTIUSER),y)
CSRCS += nx_server.c
endif
ASRCS =
CSRCS = target.c
COBJS = $(CSRCS:.c=$(OBJEXT))
AOBJS = $(ASRCS:.S=$(OBJEXT))
COBJS = $(CSRCS:.c=$(OBJEXT))
SRCS = $(ASRCS) $(CSRCS)
OBJS = $(AOBJS) $(COBJS)
SRCS = $(ASRCS) $(CSRCS)
OBJS = $(AOBJS) $(COBJS)
BIN = ../../libapps$(LIBEXT)
BIN = libapp$(LIBEXT)
ROOTDEPPATH = --dep-path .
all: $(BIN)
# Common build
VPATH =
all: .built
.PHONY: .built clean depend disclean
$(AOBJS): %$(OBJEXT): %.S
$(call ASSEMBLE, $<, $@)
@ -64,15 +69,19 @@ $(BIN): $(OBJS)
@( for obj in $(OBJS) ; do \
$(call ARCHIVE, $@, $${obj}); \
done ; )
@touch .built
.built: $(BIN)
.depend: Makefile $(SRCS)
@$(MKDEP) $(CC) -- $(CFLAGS) -- $(SRCS) >Make.dep
@$(MKDEP) $(ROOTDEPPATH) $(CC) -- $(CFLAGS) -- $(SRCS) >Make.dep
@touch $@
# Register application
depend: .depend
clean:
@rm -f $(BIN) *~ .*.swp
@rm -f $(BIN) *.o *~ .*.swp .built
$(call CLEAN)
distclean: clean

View File

@ -1,7 +1,7 @@
############################################################################
# examples/dhcpd/Makefile.host
# apps/examples/dhcpd/Makefile.host
#
# Copyright (C) 2007, 2009 Gregory Nutt. All rights reserved.
# Copyright (C) 2007, 2009, 2011 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt <spudmonkey@racsa.co.cr>
#
# Redistribution and use in source and binary forms, with or without
@ -33,8 +33,8 @@
#
############################################################################
WD = ${shell pwd}
TOPDIR = $(WD)/../..
# TOPDIR must be defined on the make command line
include $(TOPDIR)/Make.defs
OBJS = host.o1 dhcpd.o1

View File

@ -1,7 +1,7 @@
############################################################################
# Makefile
# apps/examples/hello/Makefile
#
# Copyright (C) 2007-2008, 2010 Gregory Nutt. All rights reserved.
# Copyright (C) 2008, 2010-2011 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt <spudmonkey@racsa.co.cr>
#
# Redistribution and use in source and binary forms, with or without
@ -35,18 +35,29 @@
-include $(TOPDIR)/.config
-include $(TOPDIR)/Make.defs
include $(APPDIR)/Make.defs
ASRCS =
AOBJS = $(ASRCS:.S=$(OBJEXT))
CSRCS = mount_main.c ramdisk.c
COBJS = $(CSRCS:.c=$(OBJEXT))
# Hello, World! Example
SRCS = $(ASRCS) $(CSRCS)
OBJS = $(AOBJS) $(COBJS)
ASRCS =
CSRCS = main.c
BIN = libapp$(LIBEXT)
AOBJS = $(ASRCS:.S=$(OBJEXT))
COBJS = $(CSRCS:.c=$(OBJEXT))
all: $(BIN)
SRCS = $(ASRCS) $(CSRCS)
OBJS = $(AOBJS) $(COBJS)
BIN = ../../libapps$(LIBEXT)
ROOTDEPPATH = --dep-path .
# Common build
VPATH =
all: .built
.PHONY: .built clean depend disclean
$(AOBJS): %$(OBJEXT): %.S
$(call ASSEMBLE, $<, $@)
@ -58,15 +69,19 @@ $(BIN): $(OBJS)
@( for obj in $(OBJS) ; do \
$(call ARCHIVE, $@, $${obj}); \
done ; )
@touch .built
.built: $(BIN)
.depend: Makefile $(SRCS)
@$(MKDEP) $(CC) -- $(CFLAGS) -- $(SRCS) >Make.dep
@$(MKDEP) $(ROOTDEPPATH) $(CC) -- $(CFLAGS) -- $(SRCS) >Make.dep
@touch $@
# Register application
depend: .depend
clean:
@rm -f $(BIN) *~ .*.swp
@rm -f $(BIN) *.o *~ .*.swp .built
$(call CLEAN)
distclean: clean

View File

@ -1,7 +1,7 @@
############################################################################
# examples/helloxx/Makefile
# apps/examples/helloxx/Makefile
#
# Copyright (C) 2009-2010 Gregory Nutt. All rights reserved.
# Copyright (C) 2009-2011 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt <spudmonkey@racsa.co.cr>
#
# Redistribution and use in source and binary forms, with or without
@ -35,21 +35,31 @@
-include $(TOPDIR)/.config
-include $(TOPDIR)/Make.defs
include $(APPDIR)/Make.defs
ASRCS =
AOBJS = $(ASRCS:.S=$(OBJEXT))
CSRCS =
COBJS = $(CSRCS:.c=$(OBJEXT))
CXXSRCS = main.cxx
CXXOBJS = $(CXXSRCS:.cxx=$(OBJEXT))
# Hello, World! C++ Example
SRCS = $(ASRCS) $(CSRCS) $(CXXSRCS)
OBJS = $(AOBJS) $(COBJS) $(CXXOBJS)
ASRCS =
CSRCS =
CXXSRCS = main.cxx
BIN = libapp$(LIBEXT)
AOBJS = $(ASRCS:.S=$(OBJEXT))
COBJS = $(CSRCS:.c=$(OBJEXT))
CXXOBJS = $(CXXSRCS:.cxx=$(OBJEXT))
all: $(BIN)
.PHONY: clean depend chkcxx
SRCS = $(ASRCS) $(CSRCS) $(CXXSRCS)
OBJS = $(AOBJS) $(COBJS) $(CXXOBJS)
BIN = ../../libapps$(LIBEXT)
ROOTDEPPATH = --dep-path .
# Common build
VPATH =
all: .built
.PHONY: .built clean depend disclean chkcxx
chkcxx:
ifneq ($(CONFIG_HAVE_CXX),y)
@ -76,15 +86,19 @@ $(BIN): chkcxx $(OBJS)
@( for obj in $(OBJS) ; do \
$(call ARCHIVE, $@, $${obj}); \
done ; )
@touch .built
.built: $(BIN)
.depend: Makefile $(SRCS)
@$(MKDEP) $(CC) -- $(CFLAGS) -- $(SRCS) >Make.dep
@$(MKDEP) $(ROOTDEPPATH) $(CC) -- $(CFLAGS) -- $(SRCS) >Make.dep
@touch $@
# Register application
depend: .depend
clean:
@rm -f $(BIN) *~ .*.swp
@rm -f $(BIN) *.o *~ .*.swp .built
$(call CLEAN)
distclean: clean

View File

@ -1,5 +1,5 @@
############################################################################
# examples/hidkbd/Makefile
# apps/examples/hidkbd/Makefile
#
# Copyright (C) 2011 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt <spudmonkey@racsa.co.cr>
@ -35,18 +35,29 @@
-include $(TOPDIR)/.config
-include $(TOPDIR)/Make.defs
include $(APPDIR)/Make.defs
ASRCS =
AOBJS = $(ASRCS:.S=$(OBJEXT))
CSRCS = hidkbd_main.c
COBJS = $(CSRCS:.c=$(OBJEXT))
# USB Host HID keyboard Example
SRCS = $(ASRCS) $(CSRCS)
OBJS = $(AOBJS) $(COBJS)
ASRCS =
CSRCS = hidkbd_main.c
BIN = libapp$(LIBEXT)
AOBJS = $(ASRCS:.S=$(OBJEXT))
COBJS = $(CSRCS:.c=$(OBJEXT))
all: $(BIN)
SRCS = $(ASRCS) $(CSRCS)
OBJS = $(AOBJS) $(COBJS)
BIN = ../../libapps$(LIBEXT)
ROOTDEPPATH = --dep-path .
# Common build
VPATH =
all: .built
.PHONY: .built clean depend disclean
$(AOBJS): %$(OBJEXT): %.S
$(call ASSEMBLE, $<, $@)
@ -58,15 +69,19 @@ $(BIN): $(OBJS)
@( for obj in $(OBJS) ; do \
$(call ARCHIVE, $@, $${obj}); \
done ; )
@touch .built
.built: $(BIN)
.depend: Makefile $(SRCS)
@$(MKDEP) $(CC) -- $(CFLAGS) -- $(SRCS) >Make.dep
@$(MKDEP) $(ROOTDEPPATH) $(CC) -- $(CFLAGS) -- $(SRCS) >Make.dep
@touch $@
# Register application
depend: .depend
clean:
@rm -f $(BIN) *~ .*.swp
@rm -f $(BIN) *.o *~ .*.swp .built
$(call CLEAN)
distclean: clean

View File

@ -1,5 +1,5 @@
############################################################################
# examples/igmp/Makefile
# apps/examples/igmp/Makefile
#
# Copyright (C) 2010 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt <spudmonkey@racsa.co.cr>
@ -35,19 +35,29 @@
-include $(TOPDIR)/.config
-include $(TOPDIR)/Make.defs
include $(APPDIR)/Make.defs
ASRCS =
AOBJS = $(ASRCS:.S=$(OBJEXT))
# IGMP Networking Example
CSRCS = igmp.c
COBJS = $(CSRCS:.c=$(OBJEXT))
ASRCS =
CSRCS = igmp.c
SRCS = $(ASRCS) $(CSRCS)
OBJS = $(AOBJS) $(COBJS)
AOBJS = $(ASRCS:.S=$(OBJEXT))
COBJS = $(CSRCS:.c=$(OBJEXT))
BIN = libapp$(LIBEXT)
SRCS = $(ASRCS) $(CSRCS)
OBJS = $(AOBJS) $(COBJS)
all: $(BIN)
BIN = ../../libapps$(LIBEXT)
ROOTDEPPATH = --dep-path .
# Common build
VPATH =
all: .built
.PHONY: .built clean depend disclean
$(AOBJS): %$(OBJEXT): %.S
$(call ASSEMBLE, $<, $@)
@ -59,15 +69,19 @@ $(BIN): $(OBJS)
@( for obj in $(OBJS) ; do \
$(call ARCHIVE, $@, $${obj}); \
done ; )
@touch .built
.built: $(BIN)
.depend: Makefile $(SRCS)
@$(MKDEP) $(CC) -- $(CFLAGS) -- $(SRCS) >Make.dep
@$(MKDEP) $(ROOTDEPPATH) $(CC) -- $(CFLAGS) -- $(SRCS) >Make.dep
@touch $@
# Register application
depend: .depend
clean:
@rm -f $(BIN) $(HOST_BIN) *~ .*.swp
@rm -f $(BIN) *.o *~ .*.swp .built
$(call CLEAN)
distclean: clean

View File

@ -1,5 +1,5 @@
############################################################################
# examples/mm/Makefile
# apps/examples/mm/Makefile
#
# Copyright (C) 2011 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt <spudmonkey@racsa.co.cr>
@ -35,18 +35,29 @@
-include $(TOPDIR)/.config
-include $(TOPDIR)/Make.defs
include $(APPDIR)/Make.defs
ASRCS =
AOBJS = $(ASRCS:.S=$(OBJEXT))
CSRCS = mm_main.c
COBJS = $(CSRCS:.c=$(OBJEXT))
# Memory Management Test
SRCS = $(ASRCS) $(CSRCS)
OBJS = $(AOBJS) $(COBJS)
ASRCS =
CSRCS = mm_main.c
BIN = libapp$(LIBEXT)
AOBJS = $(ASRCS:.S=$(OBJEXT))
COBJS = $(CSRCS:.c=$(OBJEXT))
all: $(BIN)
SRCS = $(ASRCS) $(CSRCS)
OBJS = $(AOBJS) $(COBJS)
BIN = ../../libapps$(LIBEXT)
ROOTDEPPATH = --dep-path .
# Common build
VPATH =
all: .built
.PHONY: .built clean depend disclean
$(AOBJS): %$(OBJEXT): %.S
$(call ASSEMBLE, $<, $@)
@ -58,15 +69,19 @@ $(BIN): $(OBJS)
@( for obj in $(OBJS) ; do \
$(call ARCHIVE, $@, $${obj}); \
done ; )
@touch .built
.built: $(BIN)
.depend: Makefile $(SRCS)
@$(MKDEP) $(CC) -- $(CFLAGS) -- $(SRCS) >Make.dep
@$(MKDEP) $(ROOTDEPPATH) $(CC) -- $(CFLAGS) -- $(SRCS) >Make.dep
@touch $@
# Register application
depend: .depend
clean:
@rm -f $(BIN) *~ .*.swp
@rm -f $(BIN) *.o *~ .*.swp .built
$(call CLEAN)
distclean: clean

View File

@ -1,7 +1,7 @@
############################################################################
# examples/pashello/Makefile
# apps/Makefile
#
# Copyright (C) 2008-2010 Gregory Nutt. All rights reserved.
# Copyright (C) 2007-2008, 2010-2010 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt <spudmonkey@racsa.co.cr>
#
# Redistribution and use in source and binary forms, with or without
@ -35,25 +35,29 @@
-include $(TOPDIR)/.config
-include $(TOPDIR)/Make.defs
include $(APPDIR)/Make.defs
ifeq ($(WINTOOL),y)
INCDIROPT = -w
endif
# mount() test
CFLAGS += ${shell $(TOPDIR)/tools/incdir.sh $(INCDIROPT) "$(CC)" $(TOPDIR)/pcode/include }
CFLAGS += ${shell $(TOPDIR)/tools/incdir.sh $(INCDIROPT) "$(CC)" $(TOPDIR)/pcode/insn/include}
ASRCS =
CSRCS = mount_main.c ramdisk.c
ASRCS =
AOBJS = $(ASRCS:.S=$(OBJEXT))
CSRCS = pashello.c device.c
COBJS = $(CSRCS:.c=$(OBJEXT))
AOBJS = $(ASRCS:.S=$(OBJEXT))
COBJS = $(CSRCS:.c=$(OBJEXT))
SRCS = $(ASRCS) $(CSRCS)
OBJS = $(AOBJS) $(COBJS)
SRCS = $(ASRCS) $(CSRCS)
OBJS = $(AOBJS) $(COBJS)
BIN = libapp$(LIBEXT)
BIN = ../../libapps$(LIBEXT)
all: $(BIN)
ROOTDEPPATH = --dep-path .
# Common build
VPATH =
all: .built
.PHONY: .built clean depend disclean
$(AOBJS): %$(OBJEXT): %.S
$(call ASSEMBLE, $<, $@)
@ -65,15 +69,19 @@ $(BIN): $(OBJS)
@( for obj in $(OBJS) ; do \
$(call ARCHIVE, $@, $${obj}); \
done ; )
@touch .built
.built: $(BIN)
.depend: Makefile $(SRCS)
@$(MKDEP) $(CC) -- $(CFLAGS) -- $(SRCS) >Make.dep
@$(MKDEP) $(ROOTDEPPATH) $(CC) -- $(CFLAGS) -- $(SRCS) >Make.dep
@touch $@
# Register application
depend: .depend
clean:
@rm -f $(BIN) *~ .*.swp
@rm -f $(BIN) *.o *~ .*.swp .built
$(call CLEAN)
distclean: clean

View File

@ -1,7 +1,7 @@
############################################################################
# examples/nettest/Makefile
#
# Copyright (C) 2007-2008, 2010 Gregory Nutt. All rights reserved.
# Copyright (C) 2007-2008, 2010-2010 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt <spudmonkey@racsa.co.cr>
#
# Redistribution and use in source and binary forms, with or without
@ -35,6 +35,9 @@
-include $(TOPDIR)/.config
-include $(TOPDIR)/Make.defs
include $(APPDIR)/Make.defs
# Basic TCP networking test
TARG_ASRCS =
TARG_AOBJS = $(TARG_ASRCS:.S=$(OBJEXT))
@ -51,7 +54,7 @@ TARG_COBJS = $(TARG_CSRCS:.c=$(OBJEXT))
TARG_SRCS = $(TARG_ASRCS) $(TARG_CSRCS)
TARG_OBJS = $(TARG_AOBJS) $(TARG_COBJS)
TARG_BIN = libapp$(LIBEXT)
TARG_BIN = ../../libapps$(LIBEXT)
HOSTCFLAGS += -DCONFIG_EXAMPLE_NETTEST_HOST=1
ifeq ($(CONFIG_EXAMPLE_NETTEST_SERVER),y)
@ -69,7 +72,14 @@ endif
HOST_OBJS = $(HOST_SRCS:.c=.o)
HOST_BIN = host
all: $(TARG_BIN)
ROOTDEPPATH = --dep-path .
# Common build
VPATH =
all: .built
.PHONY: .built clean depend disclean
$(TARG_AOBJS): %$(OBJEXT): %.S
$(call ASSEMBLE, $<, $@)
@ -77,7 +87,7 @@ $(TARG_AOBJS): %$(OBJEXT): %.S
$(TARG_COBJS): %$(OBJEXT): %.c
$(call COMPILE, $<, $@)
$(TARG_BIN): $(TARG_OBJS) $(HOST_BIN)
$(TARG_BIN): $(TARG_OBJS) $(HOST_BIN)
@( for obj in $(TARG_OBJS) ; do \
$(call ARCHIVE, $@, $${obj}); \
done ; )
@ -86,21 +96,26 @@ $(HOST_OBJS): %.o: %.c
@echo "CC: $<"
@$(HOSTCC) -c $(HOSTCFLAGS) $< -o $@
$(HOST_BIN): $(HOST_OBJS)
$(HOST_BIN): $(HOST_OBJS)
@echo "LD: $@"
@$(HOSTCC) $(HOSTLDFLAGS) $(HOST_OBJS) -o $@
.built: $(TARG_BIN) $(HOST_BIN)
@touch .built
.depend: Makefile $(TARG_SRCS)
@$(MKDEP) $(CC) -- $(CFLAGS) -- $(TARG_SRCS) >Make.dep
@$(MKDEP) $(ROOTDEPPATH) $(CC) -- $(CFLAGS) -- $(TARG_SRCS) >Make.dep
@touch $@
# Register application
depend: .depend
clean:
@rm -f $(TARG_BIN) $(HOST_BIN) *~ .*.swp
@rm -f $(TARG_BIN) $(HOST_BIN) .built *.o *~ .*.swp
$(call CLEAN)
distclean: clean
@rm -f Make.dep .depend
-include Make.dep

View File

@ -1,5 +1,5 @@
############################################################################
# examples/nsh/Makefile
# apps/examples/nsh/Makefile
#
# Copyright (C) 2007-2008, 2010-2011 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt <spudmonkey@racsa.co.cr>
@ -35,19 +35,29 @@
-include $(TOPDIR)/.config
-include $(TOPDIR)/Make.defs
include $(APPDIR)/Make.defs
ASRCS =
CSRCS = nsh_main.c
# NuttShell (NSH) Example
AOBJS = $(ASRCS:.S=$(OBJEXT))
COBJS = $(CSRCS:.c=$(OBJEXT))
ASRCS =
CSRCS = nsh_main.c
SRCS = $(ASRCS) $(CSRCS)
OBJS = $(AOBJS) $(COBJS)
AOBJS = $(ASRCS:.S=$(OBJEXT))
COBJS = $(CSRCS:.c=$(OBJEXT))
BIN = libapp$(LIBEXT)
SRCS = $(ASRCS) $(CSRCS)
OBJS = $(AOBJS) $(COBJS)
all: $(BIN)
BIN = ../../libapps$(LIBEXT)
ROOTDEPPATH = --dep-path .
# Common build
VPATH =
all: .built
.PHONY: .built clean depend disclean
$(AOBJS): %$(OBJEXT): %.S
$(call ASSEMBLE, $<, $@)
@ -59,15 +69,19 @@ $(BIN): $(OBJS)
@( for obj in $(OBJS) ; do \
$(call ARCHIVE, $@, $${obj}); \
done ; )
@touch .built
.built: $(BIN)
.depend: Makefile $(SRCS)
@$(MKDEP) $(CC) -- $(CFLAGS) -- $(SRCS) >Make.dep
@$(MKDEP) $(ROOTDEPPATH) $(CC) -- $(CFLAGS) -- $(SRCS) >Make.dep
@touch $@
# Register application
depend: .depend
clean:
@rm -f $(BIN) *~ .*.swp
@rm -f $(BIN) *.o *~ .*.swp .built
$(call CLEAN)
distclean: clean

View File

@ -1,7 +1,7 @@
############################################################################
# examples/null/Makefile
#
# Copyright (C) 2007-2008, 2010 Gregory Nutt. All rights reserved.
# Copyright (C) 2007-2008, 2010-2011 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt <spudmonkey@racsa.co.cr>
#
# Redistribution and use in source and binary forms, with or without
@ -35,18 +35,29 @@
-include $(TOPDIR)/.config
-include $(TOPDIR)/Make.defs
include $(APPDIR)/Make.defs
ASRCS =
AOBJS = $(ASRCS:.S=$(OBJEXT))
CSRCS = null_main.c
COBJS = $(CSRCS:.c=$(OBJEXT))
# The smallest thing you can build -- the NULL example.
SRCS = $(ASRCS) $(CSRCS)
OBJS = $(AOBJS) $(COBJS)
ASRCS =
CSRCS = null_main.c
BIN = libapp$(LIBEXT)
AOBJS = $(ASRCS:.S=$(OBJEXT))
COBJS = $(CSRCS:.c=$(OBJEXT))
all: $(BIN)
SRCS = $(ASRCS) $(CSRCS)
OBJS = $(AOBJS) $(COBJS)
BIN = ../../libapps$(LIBEXT)
ROOTDEPPATH = --dep-path .
# Common build
VPATH =
all: .built
.PHONY: .built clean depend disclean
$(AOBJS): %$(OBJEXT): %.S
$(call ASSEMBLE, $<, $@)
@ -58,15 +69,19 @@ $(BIN): $(OBJS)
@( for obj in $(OBJS) ; do \
$(call ARCHIVE, $@, $${obj}); \
done ; )
@touch .built
.built: $(BIN)
.depend: Makefile $(SRCS)
@$(MKDEP) $(CC) -- $(CFLAGS) -- $(SRCS) >Make.dep
@$(MKDEP) $(ROOTDEPPATH) $(CC) -- $(CFLAGS) -- $(SRCS) >Make.dep
@touch $@
# Register application
depend: .depend
clean:
@rm -f $(BIN) *~ .*.swp
@rm -f $(BIN) *.o *~ .*.swp .built
$(call CLEAN)
distclean: clean

93
apps/examples/nx/Makefile Normal file
View File

@ -0,0 +1,93 @@
############################################################################
# apps/examples/nxflat/Makefile
#
# Copyright (C) 2009-2011 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt <spudmonkey@racsa.co.cr>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in
# the documentation and/or other materials provided with the
# distribution.
# 3. Neither the name NuttX nor the names of its contributors may be
# used to endorse or promote products derived from this software
# without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
#
############################################################################
-include $(TOPDIR)/.config
-include $(TOPDIR)/Make.defs
include $(APPDIR)/Make.defs
# NuttX NX Graphics Example.
ASRCS =
CSRCS = nx_main.c nx_events.c nx_kbdin.c
ifeq ($(CONFIG_NX_MULTIUSER),y)
CSRCS += nx_server.c
endif
AOBJS = $(ASRCS:.S=$(OBJEXT))
COBJS = $(CSRCS:.c=$(OBJEXT))
SRCS = $(ASRCS) $(CSRCS)
OBJS = $(AOBJS) $(COBJS)
BIN = ../../libapps$(LIBEXT)
ROOTDEPPATH = --dep-path .
# Common build
VPATH =
all: .built
.PHONY: .built clean depend disclean
$(AOBJS): %$(OBJEXT): %.S
$(call ASSEMBLE, $<, $@)
$(COBJS): %$(OBJEXT): %.c
$(call COMPILE, $<, $@)
$(BIN): $(OBJS)
@( for obj in $(OBJS) ; do \
$(call ARCHIVE, $@, $${obj}); \
done ; )
@touch .built
.built: $(BIN)
.depend: Makefile $(SRCS)
@$(MKDEP) $(ROOTDEPPATH) $(CC) -- $(CFLAGS) -- $(SRCS) >Make.dep
@touch $@
# Register application
depend: .depend
clean:
@rm -f $(BIN) *.o *~ .*.swp .built
$(call CLEAN)
distclean: clean
@rm -f Make.dep .depend
-include Make.dep

View File

@ -1,7 +1,7 @@
############################################################################
# examples/nxflat/Makefile
# apps/examples/nxflat/Makefile
#
# Copyright (C) 2008, 2010 Gregory Nutt. All rights reserved.
# Copyright (C) 2008, 2010-2011 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt <spudmonkey@racsa.co.cr>
#
# Redistribution and use in source and binary forms, with or without
@ -35,19 +35,29 @@
-include $(TOPDIR)/.config
-include $(TOPDIR)/Make.defs
include $(APPDIR)/Make.defs
ASRCS =
AOBJS = $(ASRCS:.S=$(OBJEXT))
CSRCS = nxflat_main.c
COBJS = $(CSRCS:.c=$(OBJEXT))
# NXFLAT Example
SRCS = $(ASRCS) $(CSRCS)
OBJS = $(AOBJS) $(COBJS)
ASRCS =
CSRCS = nxflat_main.c
BIN = libapp$(LIBEXT)
AOBJS = $(ASRCS:.S=$(OBJEXT))
COBJS = $(CSRCS:.c=$(OBJEXT))
all: $(BIN)
.PHONY: headers clean distclean
SRCS = $(ASRCS) $(CSRCS)
OBJS = $(AOBJS) $(COBJS)
BIN = ../../libapps$(LIBEXT)
ROOTDEPPATH = --dep-path .
# Common build
VPATH =
all: .built
.PHONY: headers .built clean depend disclean
$(AOBJS): %$(OBJEXT): %.S
$(call ASSEMBLE, $<, $@)
@ -56,22 +66,30 @@ $(COBJS): %$(OBJEXT): %.c
$(call COMPILE, $<, $@)
headers:
@$(MAKE) -C tests TOPDIR=$(TOPDIR) CROSSDEV=$(CROSSDEV)
@$(MAKE) -C tests TOPDIR=$(TOPDIR) APPDIR=$(APPDIR) CROSSDEV=$(CROSSDEV)
$(BIN): headers $(OBJS)
$(BIN): $(OBJS)
@( for obj in $(OBJS) ; do \
$(call ARCHIVE, $@, $${obj}); \
done ; )
@touch .built
.built: $(BIN)
# We can't make dependencies in this directory because the required
# header files may not yet exist.
depend:
.depend:
@touch $@
# Register application
depend: .depend
clean:
@rm -f $(BIN) *~ .*.swp
@rm -f $(BIN) *.o *~ .*.swp .built
$(call CLEAN)
distclean: clean
@rm -f Make.dep .depend
-include Make.dep

View File

@ -1,7 +1,7 @@
############################################################################
# examples/nxflat/Makefile
# apps/examples/nxflat/tests/Makefile
#
# Copyright (C) 2009 Gregory Nutt. All rights reserved.
# Copyright (C) 2009, 2011 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt <spudmonkey@racsa.co.cr>
#
# Redistribution and use in source and binary forms, with or without
@ -37,7 +37,7 @@
#SUBDIRS = errno hello hello++ longjmp mutex pthread signal task struct
SUBDIRS = errno hello mutex pthread task struct
NXFLAT_DIR = $(TOPDIR)/examples/nxflat
NXFLAT_DIR = $(APPDIR)/examples/nxflat
TESTS_DIR = $(NXFLAT_DIR)/tests
ROMFS_DIR = $(TESTS_DIR)/romfs
ROMFS_IMG = $(TESTS_DIR)/romfs.img
@ -47,7 +47,7 @@ SYMTAB = $(TESTS_DIR)/symtab.h
define DIR_template
$(1)_$(2):
@$(MAKE) -C $(1) $(3) TOPDIR=$(TOPDIR) ROMFS_DIR=$(ROMFS_DIR) CROSSDEV=$(CROSSDEV)
@$(MAKE) -C $(1) $(3) TOPDIR=$(TOPDIR) APPDIR=$(APPDIR) ROMFS_DIR=$(ROMFS_DIR) CROSSDEV=$(CROSSDEV)
endef
all: $(ROMFS_HDR) $(ROMFS_DIRLIST) $(SYMTAB)

View File

@ -1,7 +1,7 @@
############################################################################
# examples/ostest/Makefile
# apps/examples/ostest/Makefile
#
# Copyright (C) 2007-2010 Gregory Nutt. All rights reserved.
# Copyright (C) 2007-2011 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt <spudmonkey@racsa.co.cr>
#
# Redistribution and use in source and binary forms, with or without
@ -35,59 +35,69 @@
-include $(TOPDIR)/.config
-include $(TOPDIR)/Make.defs
include $(APPDIR)/Make.defs
ASRCS =
AOBJS = $(ASRCS:.S=$(OBJEXT))
CSRCS = main.c dev_null.c
# NuttX OS Test
ASRCS =
CSRCS = main.c dev_null.c
ifneq ($(CONFIG_DISABLE_PTHREAD),y)
CSRCS += cancel.c cond.c mutex.c sem.c barrier.c
CSRCS += cancel.c cond.c mutex.c sem.c barrier.c
ifneq ($(CONFIG_RR_INTERVAL),0)
CSRCS += roundrobin.c
CSRCS += roundrobin.c
endif # CONFIG_RR_INTERVAL
ifeq ($(CONFIG_MUTEX_TYPES),y)
CSRCS += rmutex.c
CSRCS += rmutex.c
endif # CONFIG_MUTEX_TYPES
endif # CONFIG_DISABLE_PTHREAD
ifneq ($(CONFIG_DISABLE_SIGNALS),y)
CSRCS += sighand.c
CSRCS += sighand.c
ifneq ($(CONFIG_DISABLE_PTHREAD),y)
ifneq ($(CONFIG_DISABLE_CLOCK),y)
CSRCS += timedwait.c
CSRCS += timedwait.c
endif # CONFIG_DISABLE_CLOCK
endif # CONFIG_DISABLE_PTHREAD
endif # CONFIG_DISABLE_SIGNALS
ifneq ($(CONFIG_DISABLE_MQUEUE),y)
ifneq ($(CONFIG_DISABLE_PTHREAD),y)
CSRCS += mqueue.c
CSRCS += mqueue.c
ifneq ($(CONFIG_DISABLE_CLOCK),y)
CSRCS += timedmqueue.c
CSRCS += timedmqueue.c
endif # CONFIG_DISABLE_CLOCK
endif # CONFIG_DISABLE_PTHREAD
endif # CONFIG_DISABLE_MQUEUE
ifneq ($(CONFIG_DISABLE_POSIX_TIMERS),y)
CSRCS += posixtimer.c
CSRCS += posixtimer.c
endif
ifneq ($(CONFIG_DISABLE_SIGNALS),y)
ifneq ($(CONFIG_DISABLE_PTHREAD),y)
ifeq ($(CONFIG_PRIORITY_INHERITANCE),y)
CSRCS += prioinherit.c
CSRCS += prioinherit.c
endif # CONFIG_PRIORITY_INHERITANCE
endif # CONFIG_DISABLE_PTHREAD
endif # CONFIG_DISABLE_SIGNALS
COBJS = $(CSRCS:.c=$(OBJEXT))
AOBJS = $(ASRCS:.S=$(OBJEXT))
COBJS = $(CSRCS:.c=$(OBJEXT))
SRCS = $(ASRCS) $(CSRCS)
OBJS = $(AOBJS) $(COBJS)
SRCS = $(ASRCS) $(CSRCS)
OBJS = $(AOBJS) $(COBJS)
BIN = libapp$(LIBEXT)
BIN = ../../libapps$(LIBEXT)
all: $(BIN)
ROOTDEPPATH = --dep-path .
# Common build
VPATH =
all: .built
.PHONY: .built clean depend disclean
$(AOBJS): %$(OBJEXT): %.S
$(call ASSEMBLE, $<, $@)
@ -99,15 +109,19 @@ $(BIN): $(OBJS)
@( for obj in $(OBJS) ; do \
$(call ARCHIVE, $@, $${obj}); \
done ; )
@touch .built
.built: $(BIN)
.depend: Makefile $(SRCS)
@$(MKDEP) $(CC) -- $(CFLAGS) -- $(SRCS) >Make.dep
@$(MKDEP) $(ROOTDEPPATH) $(CC) -- $(CFLAGS) -- $(SRCS) >Make.dep
@touch $@
# Register application
depend: .depend
clean:
@rm -f $(BIN) *~ .*.swp
@rm -f $(BIN) *.o *~ .*.swp .built
$(call CLEAN)
distclean: clean

View File

@ -0,0 +1,97 @@
############################################################################
# apps/examples/pashello/Makefile
#
# Copyright (C) 2008-2011 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt <spudmonkey@racsa.co.cr>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in
# the documentation and/or other materials provided with the
# distribution.
# 3. Neither the name NuttX nor the names of its contributors may be
# used to endorse or promote products derived from this software
# without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
#
############################################################################
-include $(TOPDIR)/.config
-include $(TOPDIR)/Make.defs
include $(APPDIR)/Make.defs
# Pascal Add-On Example
ifeq ($(WINTOOL),y)
INCDIROPT = -w
endif
CFLAGS += ${shell $(TOPDIR)/tools/incdir.sh $(INCDIROPT) "$(CC)" $(TOPDIR)/pcode/include }
CFLAGS += ${shell $(TOPDIR)/tools/incdir.sh $(INCDIROPT) "$(CC)" $(TOPDIR)/pcode/insn/include}
ASRCS =
CSRCS = pashello.c device.c
AOBJS = $(ASRCS:.S=$(OBJEXT))
COBJS = $(CSRCS:.c=$(OBJEXT))
SRCS = $(ASRCS) $(CSRCS)
OBJS = $(AOBJS) $(COBJS)
BIN = ../../libapps$(LIBEXT)
ROOTDEPPATH = --dep-path .
# Common build
VPATH =
all: .built
.PHONY: .built clean depend disclean
$(AOBJS): %$(OBJEXT): %.S
$(call ASSEMBLE, $<, $@)
$(COBJS): %$(OBJEXT): %.c
$(call COMPILE, $<, $@)
$(BIN): $(OBJS)
@( for obj in $(OBJS) ; do \
$(call ARCHIVE, $@, $${obj}); \
done ; )
@touch .built
.built: $(BIN)
.depend: Makefile $(SRCS)
@$(MKDEP) $(ROOTDEPPATH) $(CC) -- $(CFLAGS) -- $(SRCS) >Make.dep
@touch $@
# Register application
depend: .depend
clean:
@rm -f $(BIN) *.o *~ .*.swp .built
$(call CLEAN)
distclean: clean
@rm -f Make.dep .depend
-include Make.dep

View File

@ -0,0 +1,90 @@
############################################################################
# apps/examples/pipe/Makefile
#
# Copyright (C) 2008, 2010-2011 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt <spudmonkey@racsa.co.cr>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in
# the documentation and/or other materials provided with the
# distribution.
# 3. Neither the name NuttX nor the names of its contributors may be
# used to endorse or promote products derived from this software
# without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
#
############################################################################
-include $(TOPDIR)/.config
-include $(TOPDIR)/Make.defs
include $(APPDIR)/Make.defs
# Pipe Example
ASRCS =
CSRCS = pipe_main.c transfer_test.c interlock_test.c redirect_test.c
AOBJS = $(ASRCS:.S=$(OBJEXT))
COBJS = $(CSRCS:.c=$(OBJEXT))
SRCS = $(ASRCS) $(CSRCS)
OBJS = $(AOBJS) $(COBJS)
BIN = ../../libapps$(LIBEXT)
ROOTDEPPATH = --dep-path .
# Common build
VPATH =
all: .built
.PHONY: .built clean depend disclean
$(AOBJS): %$(OBJEXT): %.S
$(call ASSEMBLE, $<, $@)
$(COBJS): %$(OBJEXT): %.c
$(call COMPILE, $<, $@)
$(BIN): $(OBJS)
@( for obj in $(OBJS) ; do \
$(call ARCHIVE, $@, $${obj}); \
done ; )
@touch .built
.built: $(BIN)
.depend: Makefile $(SRCS)
@$(MKDEP) $(ROOTDEPPATH) $(CC) -- $(CFLAGS) -- $(SRCS) >Make.dep
@touch $@
# Register application
depend: .depend
clean:
@rm -f $(BIN) *.o *~ .*.swp .built
$(call CLEAN)
distclean: clean
@rm -f Make.dep .depend
-include Make.dep

View File

@ -1,7 +1,7 @@
############################################################################
# examples/poll/Makefile
# apps/examples/poll/Makefile
#
# Copyright (C) 2008, 2010 Gregory Nutt. All rights reserved.
# Copyright (C) 2008, 2010-2011 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt <spudmonkey@racsa.co.cr>
#
# Redistribution and use in source and binary forms, with or without
@ -35,18 +35,29 @@
-include $(TOPDIR)/.config
-include $(TOPDIR)/Make.defs
include $(APPDIR)/Make.defs
ASRCS =
AOBJS = $(ASRCS:.S=$(OBJEXT))
CSRCS = poll_main.c poll_listener.c select_listener.c net_listener.c net_reader.c
COBJS = $(CSRCS:.c=$(OBJEXT))
# Device Driver poll()/select() Example
SRCS = $(ASRCS) $(CSRCS)
OBJS = $(AOBJS) $(COBJS)
ASRCS =
CSRCS = poll_main.c poll_listener.c select_listener.c net_listener.c net_reader.c
BIN = libapp$(LIBEXT)
AOBJS = $(ASRCS:.S=$(OBJEXT))
COBJS = $(CSRCS:.c=$(OBJEXT))
all: $(BIN)
SRCS = $(ASRCS) $(CSRCS)
OBJS = $(AOBJS) $(COBJS)
BIN = ../../libapps$(LIBEXT)
ROOTDEPPATH = --dep-path .
# Common build
VPATH =
all: .built
.PHONY: .built clean depend disclean
$(AOBJS): %$(OBJEXT): %.S
$(call ASSEMBLE, $<, $@)
@ -58,15 +69,19 @@ $(BIN): $(OBJS)
@( for obj in $(OBJS) ; do \
$(call ARCHIVE, $@, $${obj}); \
done ; )
@touch .built
.built: $(BIN)
.depend: Makefile $(SRCS)
@$(MKDEP) $(CC) -- $(CFLAGS) -- $(SRCS) >Make.dep
@$(MKDEP) $(ROOTDEPPATH) $(CC) -- $(CFLAGS) -- $(SRCS) >Make.dep
@touch $@
# Register application
depend: .depend
clean:
@rm -f $(BIN) *~ .*.swp
@rm -f $(BIN) *.o *~ .*.swp .built
$(call CLEAN)
distclean: clean

View File

@ -1,7 +1,7 @@
############################################################################
# examples/poll/Makefile.host
# apps/examples/poll/Makefile.host
#
# Copyright (C) 2008, 2009 Gregory Nutt. All rights reserved.
# Copyright (C) 2008, 2009, 2011 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt <spudmonkey@racsa.co.cr>
#
# Redistribution and use in source and binary forms, with or without
@ -33,6 +33,8 @@
#
############################################################################
# TOPDIR must be defined on the make command line
include $(TOPDIR)/.config
include $(TOPDIR)/Make.defs
@ -49,3 +51,4 @@ $(BIN): $(SRC)
clean:
@rm -f $(BIN) *~ .*.swp *.o
$(call CLEAN)

Some files were not shown because too many files have changed in this diff Show More