summaryrefslogtreecommitdiff
path: root/demos/device/device_os_none/makefile
diff options
context:
space:
mode:
authorhathach <[email protected]>2013-11-01 12:17:54 +0700
committerhathach <[email protected]>2013-11-01 12:17:54 +0700
commitf797c4e02a1a2451e6ba9beca5a1be74fd0bf1ab (patch)
tree98fb54d0950fe9bdf8032ffb9c6773cb8fe7f2be /demos/device/device_os_none/makefile
parent077b6defe9eb1f55839c922cc49b184ac011a55c (diff)
rename device project
Diffstat (limited to 'demos/device/device_os_none/makefile')
-rw-r--r--demos/device/device_os_none/makefile100
1 files changed, 100 insertions, 0 deletions
diff --git a/demos/device/device_os_none/makefile b/demos/device/device_os_none/makefile
new file mode 100644
index 000000000..8fa92b54d
--- /dev/null
+++ b/demos/device/device_os_none/makefile
@@ -0,0 +1,100 @@
+#######################################################################################
+# Software License Agreement (BSD License)
+# Copyright (c) 2012, hathach (tinyusb.org)
+# All rights reserved.
+#
+# 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. The name of the author may not be used to endorse or promote products
+# derived from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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.
+#######################################################################################
+
+##################################################
+# Keyboard makefile
+##################################################
+
+############ Toolchain ############
+toolchain := lpcxpresso
+CC := arm-none-eabi-gcc
+RM := rm -rf
+#AR LD
+
+toolchain_def = __REDLIB__ __CODE_RED __USE_CMSIS=CMSISv2p00_LPC11Uxx
+mcu = lpc11uxx
+build_path = ../build/
+
+#helper function
+rel2abs = $(shell cd $(1); pwd)
+
+#path
+tinyusb_path = ../../../tinyusb
+bsp_path = ../../bsp
+cmsis_path = ../../../../CMSISv2p00_LPC11Uxx
+
+build_path_abs = $(CURDIR)/$(build_path_relative)
+tinyusb_path_abs = $(CURDIR)/$(tinyusb_path)
+bsp_path_abs = $(CURDIR)/$(bsp_path)
+cmsis_path_abs = $(CURDIR)/$(cmsis_path)
+
+############ Sources ############
+src = $(shell find $(CURDIR) -type f -name "*.c") $(tinyusb_src) $(bsp_src)
+objects = $(subst .c,.o,$(src))
+dependencies = $(subst .c,.d,$(src))
+
+tinyusb_src = $(shell find $(tinyusb_path_abs) \( ! -name "*hal*" \) -type f -name "*.c") $(tinyusb_path_abs)/hal/hal_$(mcu).c
+bsp_src = $(shell find $(bsp_path_abs)/boards -type f -name "*.c") $(shell find $(bsp_path_abs)/$(mcu) -type f -name "*.c")
+cmsis_src = $(shell find $(cmsis_path_abs) -type f -name "*.c")
+
+############ CFLAGS C Compiler Flag ##############
+#CFLAGS = $(addprefix -D,$(toolchain_def) $(macros_def)) $(addprefix -I,$(inc_path))
+
+############ LDFLAGS Linker Flag ##############
+#LDFLAGS
+
+############ CPPFLAGS C Preprocessor Flag ##############
+CPPFLAGS = $(addprefix -D,$(toolchain_def) $(macros_def)) $(addprefix -I,$(inc_path))
+
+macros_def += BOARD=BOARD_AT86RF2XX
+macros_def += MCU=MCU_LPC11UXX
+
+inc_path = $(CURDIR) $(tinyusb_path_abs) $(bsp_path_abs) $(cmsis_path_abs)/inc
+
+############ Compile Rules ##############
+#%.o : %.c
+
+############ Target ##############
+all: keyboard.axf
+
+keyboard.axf : $(objects)
+
+clean:
+ -$(RM) $(objects) $(dependencies) keyboard.axf
+
+.PHONY: all clean
+
+############ Dependencies Generate and Inlcude ############
+ifneq ($(MAKECMDGOALS),clean)
+include $(dependencies)
+endif
+
+%.d: %.c
+ $(CC) -M $(CPPFLAGS) $< > $@.$$$$; \
+ sed 's,\($*\)\.o[ :]*,\1.o $@ : ,g' < $@.$$$$ > $@; \
+ rm -f $@.$$$$