2012-01-11 13:01:26 +00:00
|
|
|
############################################################################
|
|
|
|
# configs/stm32f4discovery/src/Makefile
|
|
|
|
#
|
2015-05-29 12:08:15 -06:00
|
|
|
# Copyright (C) 2011-2013, 2015 Gregory Nutt. All rights reserved.
|
2012-01-11 13:01:26 +00:00
|
|
|
# Author: Gregory Nutt <gnutt@nuttx.org>
|
|
|
|
#
|
|
|
|
# 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)/Make.defs
|
|
|
|
|
2012-11-21 19:54:44 +00:00
|
|
|
CFLAGS += -I$(TOPDIR)/sched
|
2012-01-11 13:01:26 +00:00
|
|
|
|
2014-04-13 16:22:22 -06:00
|
|
|
ASRCS =
|
2012-11-21 19:54:44 +00:00
|
|
|
AOBJS = $(ASRCS:.S=$(OBJEXT))
|
2012-01-11 13:01:26 +00:00
|
|
|
|
2014-09-20 12:55:23 -06:00
|
|
|
CSRCS = stm32_boot.c stm32_bringup.c stm32_spi.c
|
2012-01-11 13:01:26 +00:00
|
|
|
|
|
|
|
ifeq ($(CONFIG_ARCH_LEDS),y)
|
2014-02-03 17:19:30 -06:00
|
|
|
CSRCS += stm32_autoleds.c
|
2012-01-11 13:01:26 +00:00
|
|
|
else
|
2014-02-03 17:19:30 -06:00
|
|
|
CSRCS += stm32_userleds.c
|
2012-01-11 13:01:26 +00:00
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(CONFIG_ARCH_BUTTONS),y)
|
2014-02-03 17:19:30 -06:00
|
|
|
CSRCS += stm32_buttons.c
|
2012-01-11 13:01:26 +00:00
|
|
|
endif
|
|
|
|
|
2012-08-29 17:41:43 +00:00
|
|
|
ifeq ($(CONFIG_STM32_OTGFS),y)
|
2014-02-03 17:19:30 -06:00
|
|
|
CSRCS += stm32_usb.c
|
2012-04-02 22:20:39 +00:00
|
|
|
endif
|
|
|
|
|
2014-09-20 12:55:23 -06:00
|
|
|
ifeq ($(CONFIG_STM32_SDIO),y)
|
|
|
|
CSRCS += stm32_sdio.c
|
|
|
|
endif
|
|
|
|
|
2012-01-11 13:01:26 +00:00
|
|
|
ifeq ($(CONFIG_PWM),y)
|
2014-03-01 14:16:34 -06:00
|
|
|
CSRCS += stm32_pwm.c
|
2012-01-11 13:01:26 +00:00
|
|
|
endif
|
|
|
|
|
2012-02-15 17:51:30 +00:00
|
|
|
ifeq ($(CONFIG_QENCODER),y)
|
2014-02-03 17:19:30 -06:00
|
|
|
CSRCS += stm32_qencoder.c
|
2012-02-15 17:51:30 +00:00
|
|
|
endif
|
|
|
|
|
2012-04-16 17:20:36 +00:00
|
|
|
ifeq ($(CONFIG_WATCHDOG),y)
|
2014-02-03 17:19:30 -06:00
|
|
|
CSRCS += stm32_watchdog.c
|
2012-04-16 17:20:36 +00:00
|
|
|
endif
|
|
|
|
|
2013-03-22 16:19:59 +00:00
|
|
|
ifeq ($(CONFIG_NSH_LIBRARY),y)
|
2014-02-03 17:19:30 -06:00
|
|
|
CSRCS += stm32_nsh.c
|
2012-08-29 17:41:43 +00:00
|
|
|
endif
|
|
|
|
|
2014-03-04 08:58:01 -06:00
|
|
|
ifeq ($(CONFIG_ARCH_CUSTOM_PMINIT),y)
|
2014-02-03 17:19:30 -06:00
|
|
|
CSRCS += stm32_pm.c
|
2012-07-25 13:35:36 +00:00
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(CONFIG_PM_BUTTONS),y)
|
2014-04-13 16:22:22 -06:00
|
|
|
CSRCS += stm32_pm_buttons.c
|
2012-07-25 13:35:36 +00:00
|
|
|
endif
|
|
|
|
|
2014-03-04 08:58:01 -06:00
|
|
|
ifeq ($(CONFIG_ARCH_IDLE_CUSTOM),y)
|
2014-02-03 17:19:30 -06:00
|
|
|
CSRCS += stm32_idle.c
|
2012-07-25 13:35:36 +00:00
|
|
|
endif
|
|
|
|
|
2012-05-24 21:31:24 +00:00
|
|
|
ifeq ($(CONFIG_STM32_FSMC),y)
|
2014-02-03 17:19:30 -06:00
|
|
|
CSRCS += stm32_extmem.c
|
2012-05-24 21:31:24 +00:00
|
|
|
|
|
|
|
ifeq ($(CONFIG_LCD_SSD1289),y)
|
2014-02-03 17:19:30 -06:00
|
|
|
CSRCS += stm32_ssd1289.c
|
2012-05-24 21:31:24 +00:00
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
2012-11-08 01:28:32 +00:00
|
|
|
ifeq ($(CONFIG_LCD_UG2864AMBAG01),y)
|
2014-02-03 17:19:30 -06:00
|
|
|
CSRCS += stm32_ug2864ambag01.c
|
2012-11-08 01:28:32 +00:00
|
|
|
endif
|
|
|
|
|
2012-12-26 20:04:57 +00:00
|
|
|
ifeq ($(CONFIG_LCD_UG2864HSWEG01),y)
|
2014-02-03 17:19:30 -06:00
|
|
|
CSRCS += stm32_ug2864hsweg01.c
|
2012-12-26 20:04:57 +00:00
|
|
|
endif
|
|
|
|
|
2012-11-21 19:54:44 +00:00
|
|
|
COBJS = $(CSRCS:.c=$(OBJEXT))
|
2012-01-11 13:01:26 +00:00
|
|
|
|
2012-11-21 19:54:44 +00:00
|
|
|
SRCS = $(ASRCS) $(CSRCS)
|
|
|
|
OBJS = $(AOBJS) $(COBJS)
|
2012-01-11 13:01:26 +00:00
|
|
|
|
2012-11-21 19:54:44 +00:00
|
|
|
ARCH_SRCDIR = $(TOPDIR)/arch/$(CONFIG_ARCH)/src
|
|
|
|
ifeq ($(CONFIG_WINDOWS_NATIVE),y)
|
|
|
|
CFLAGS += -I$(ARCH_SRCDIR)\chip -I$(ARCH_SRCDIR)\common -I$(ARCH_SRCDIR)\armv7-m
|
|
|
|
else
|
2012-01-11 13:01:26 +00:00
|
|
|
ifeq ($(WINTOOL),y)
|
2012-11-21 19:54:44 +00:00
|
|
|
CFLAGS += -I "${shell cygpath -w $(ARCH_SRCDIR)/chip}" \
|
|
|
|
-I "${shell cygpath -w $(ARCH_SRCDIR)/common}" \
|
|
|
|
-I "${shell cygpath -w $(ARCH_SRCDIR)/armv7-m}"
|
2012-01-11 13:01:26 +00:00
|
|
|
else
|
2012-11-21 19:54:44 +00:00
|
|
|
CFLAGS += -I$(ARCH_SRCDIR)/chip -I$(ARCH_SRCDIR)/common -I$(ARCH_SRCDIR)/armv7-m
|
|
|
|
endif
|
2012-01-11 13:01:26 +00:00
|
|
|
endif
|
|
|
|
|
|
|
|
all: libboard$(LIBEXT)
|
|
|
|
|
|
|
|
$(AOBJS): %$(OBJEXT): %.S
|
|
|
|
$(call ASSEMBLE, $<, $@)
|
|
|
|
|
|
|
|
$(COBJS) $(LINKOBJS): %$(OBJEXT): %.c
|
|
|
|
$(call COMPILE, $<, $@)
|
|
|
|
|
|
|
|
libboard$(LIBEXT): $(OBJS)
|
2012-11-15 17:43:29 +00:00
|
|
|
$(call ARCHIVE, $@, $(OBJS))
|
2012-01-11 13:01:26 +00:00
|
|
|
|
|
|
|
.depend: Makefile $(SRCS)
|
2012-11-17 18:54:53 +00:00
|
|
|
$(Q) $(MKDEP) $(CC) -- $(CFLAGS) -- $(SRCS) >Make.dep
|
|
|
|
$(Q) touch $@
|
2012-01-11 13:01:26 +00:00
|
|
|
|
|
|
|
depend: .depend
|
|
|
|
|
|
|
|
clean:
|
2012-11-20 15:47:41 +00:00
|
|
|
$(call DELFILE, libboard$(LIBEXT))
|
2012-01-11 13:01:26 +00:00
|
|
|
$(call CLEAN)
|
|
|
|
|
|
|
|
distclean: clean
|
2012-11-20 15:47:41 +00:00
|
|
|
$(call DELFILE, Make.dep)
|
|
|
|
$(call DELFILE, .depend)
|
2012-01-11 13:01:26 +00:00
|
|
|
|
|
|
|
-include Make.dep
|