2008-01-08 01:19:24 +01:00
|
|
|
############################################################################
|
|
|
|
# drivers/Makefile
|
2007-02-18 00:21:28 +01:00
|
|
|
#
|
2012-01-22 17:42:49 +01:00
|
|
|
# Copyright (C) 2007-2012 Gregory Nutt. All rights reserved.
|
2011-12-21 16:50:06 +01:00
|
|
|
# Author: Gregory Nutt <gnutt@nuttx.org>
|
2007-02-18 00:21:28 +01:00
|
|
|
#
|
|
|
|
# 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.
|
2008-01-08 01:19:24 +01:00
|
|
|
# 3. Neither the name NuttX nor the names of its contributors may be
|
2007-02-18 00:21:28 +01:00
|
|
|
# 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.
|
|
|
|
#
|
2008-01-08 01:19:24 +01:00
|
|
|
############################################################################
|
2007-02-18 00:21:28 +01:00
|
|
|
|
|
|
|
-include $(TOPDIR)/Make.defs
|
|
|
|
|
2009-06-24 22:57:34 +02:00
|
|
|
ifeq ($(WINTOOL),y)
|
2011-04-19 20:51:02 +02:00
|
|
|
INCDIROPT = -w
|
2009-06-24 22:57:34 +02:00
|
|
|
endif
|
|
|
|
|
2011-05-16 17:09:39 +02:00
|
|
|
DEPPATH = --dep-path .
|
|
|
|
ASRCS =
|
|
|
|
CSRCS =
|
|
|
|
VPATH = .
|
2011-04-20 15:32:49 +02:00
|
|
|
|
2011-05-16 17:09:39 +02:00
|
|
|
# Include support for various drivers. Each Make.defs file will add its
|
|
|
|
# files to the source file list, add its DEPPATH info, and will add
|
|
|
|
# the appropriate paths to the VPATH variable
|
2009-10-18 15:52:21 +02:00
|
|
|
|
2011-08-19 16:05:05 +02:00
|
|
|
include analog/Make.defs
|
2011-07-29 20:51:56 +02:00
|
|
|
include bch/Make.defs
|
|
|
|
include input/Make.defs
|
|
|
|
include lcd/Make.defs
|
|
|
|
include mmcsd/Make.defs
|
|
|
|
include mtd/Make.defs
|
2007-11-02 21:20:34 +01:00
|
|
|
include net/Make.defs
|
2009-10-18 15:52:21 +02:00
|
|
|
include pipes/Make.defs
|
2012-01-22 17:42:49 +01:00
|
|
|
include power/Make.defs
|
2011-07-29 20:51:56 +02:00
|
|
|
include sensors/Make.defs
|
2012-03-24 18:27:38 +01:00
|
|
|
include sercomm/Make.defs
|
2011-07-29 20:51:56 +02:00
|
|
|
include serial/Make.defs
|
2008-09-30 14:24:11 +02:00
|
|
|
include usbdev/Make.defs
|
2010-12-14 04:39:31 +01:00
|
|
|
include usbhost/Make.defs
|
2011-04-20 15:32:49 +02:00
|
|
|
include wireless/Make.defs
|
2007-02-18 00:21:28 +01:00
|
|
|
|
2007-11-20 21:32:33 +01:00
|
|
|
ifneq ($(CONFIG_NFILE_DESCRIPTORS),0)
|
2011-12-21 16:50:06 +01:00
|
|
|
CSRCS += dev_null.c dev_zero.c loop.c
|
2011-12-22 16:59:50 +01:00
|
|
|
|
2008-06-01 22:08:20 +02:00
|
|
|
ifneq ($(CONFIG_DISABLE_MOUNTPOINT),y)
|
2011-05-16 17:09:39 +02:00
|
|
|
CSRCS += ramdisk.c rwbuffer.c
|
2008-06-01 22:08:20 +02:00
|
|
|
endif
|
2011-12-22 16:59:50 +01:00
|
|
|
|
2012-02-11 01:32:53 +01:00
|
|
|
ifeq ($(CONFIG_RAMLOG),y)
|
|
|
|
CSRCS += ramlog.c
|
|
|
|
endif
|
|
|
|
|
2011-12-22 16:59:50 +01:00
|
|
|
ifeq ($(CONFIG_CAN),y)
|
2011-12-21 16:50:06 +01:00
|
|
|
CSRCS += can.c
|
|
|
|
endif
|
2011-12-22 16:59:50 +01:00
|
|
|
|
2011-12-16 17:17:34 +01:00
|
|
|
ifeq ($(CONFIG_PWM),y)
|
|
|
|
CSRCS += pwm.c
|
|
|
|
endif
|
2012-04-14 01:37:52 +02:00
|
|
|
|
|
|
|
ifeq ($(CONFIG_WATCHDOG),y)
|
|
|
|
CSRCS += watchdog.c
|
|
|
|
endif
|
2007-11-20 21:32:33 +01:00
|
|
|
endif
|
2011-05-16 17:09:39 +02:00
|
|
|
|
|
|
|
AOBJS = $(ASRCS:.S=$(OBJEXT))
|
2007-02-28 00:59:20 +01:00
|
|
|
COBJS = $(CSRCS:.c=$(OBJEXT))
|
2007-02-18 00:21:28 +01:00
|
|
|
|
|
|
|
SRCS = $(ASRCS) $(CSRCS)
|
|
|
|
OBJS = $(AOBJS) $(COBJS)
|
|
|
|
|
2011-03-30 21:51:19 +02:00
|
|
|
BIN = libdrivers$(LIBEXT)
|
2007-02-18 00:21:28 +01:00
|
|
|
|
|
|
|
all: $(BIN)
|
|
|
|
|
2007-02-28 00:59:20 +01:00
|
|
|
$(AOBJS): %$(OBJEXT): %.S
|
2008-01-08 18:06:21 +01:00
|
|
|
$(call ASSEMBLE, $<, $@)
|
2007-02-18 00:21:28 +01:00
|
|
|
|
2007-02-28 14:42:19 +01:00
|
|
|
$(COBJS): %$(OBJEXT): %.c
|
2008-01-08 18:06:21 +01:00
|
|
|
$(call COMPILE, $<, $@)
|
2007-02-18 00:21:28 +01:00
|
|
|
|
|
|
|
$(BIN): $(OBJS)
|
2008-01-08 14:41:00 +01:00
|
|
|
@( for obj in $(OBJS) ; do \
|
2008-01-08 18:06:21 +01:00
|
|
|
$(call ARCHIVE, $@, $${obj}); \
|
2007-02-21 22:55:16 +01:00
|
|
|
done ; )
|
2007-02-18 00:21:28 +01:00
|
|
|
|
|
|
|
.depend: Makefile $(SRCS)
|
2011-05-16 17:09:39 +02:00
|
|
|
@$(MKDEP) $(DEPPATH) $(CC) -- $(CFLAGS) -- $(SRCS) >Make.dep
|
2008-01-08 14:41:00 +01:00
|
|
|
@touch $@
|
2007-02-18 00:21:28 +01:00
|
|
|
|
|
|
|
depend: .depend
|
|
|
|
|
|
|
|
clean:
|
2008-01-10 14:38:13 +01:00
|
|
|
@rm -f $(BIN) *~ .*.swp
|
|
|
|
$(call CLEAN)
|
2007-02-18 00:21:28 +01:00
|
|
|
|
|
|
|
distclean: clean
|
2008-01-10 14:38:13 +01:00
|
|
|
@rm -f Make.dep .depend
|
2007-02-18 00:21:28 +01:00
|
|
|
|
|
|
|
-include Make.dep
|