Advertisement
Guest User

Untitled

a guest
Dec 28th, 2016
163
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 17.89 KB | None | 0 0
  1. #_______________________________________________________________________________
  2. #
  3. #                         edam's Arduino makefile
  4. #_______________________________________________________________________________
  5. #                                                                    version 0.5
  6. #
  7. # Copyright (C) 2011, 2012, 2013 Tim Marston <tim@ed.am>.
  8. #
  9. # Permission is hereby granted, free of charge, to any person obtaining a copy
  10. # of this software and associated documentation files (the "Software"), to deal
  11. # in the Software without restriction, including without limitation the rights
  12. # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  13. # copies of the Software, and to permit persons to whom the Software is
  14. # furnished to do so, subject to the following conditions:
  15. #
  16. # The above copyright notice and this permission notice shall be included in
  17. # all copies or substantial portions of the Software.
  18. #
  19. # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  20. # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  21. # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  22. # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  23. # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  24. # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  25. # SOFTWARE.
  26. #
  27. #_______________________________________________________________________________
  28. #
  29. #
  30. # This is a general purpose makefile for use with Arduino hardware and
  31. # software.  It works with the arduino-1.0 and later software releases.  It
  32. # should work GNU/Linux and OS X.  To download the latest version of this
  33. # makefile visit the following website where you can also find documentation on
  34. # it's use.  (The following text can only really be considered a reference.)
  35. #
  36. #   http://ed.am/dev/make/arduino-mk
  37. #
  38. # This makefile can be used as a drop-in replacement for the Arduino IDE's
  39. # build system.  To use it, just copy arduino.mk in to your project directory.
  40. # Or, you could save it somewhere (I keep mine at ~/src/arduino.mk) and create
  41. # a symlink to it in your project directory, named "Makefile".  For example:
  42. #
  43. #   $ ln -s ~/src/arduino.mk Makefile
  44. #
  45. # The Arduino software (version 1.0 or later) is required.  On GNU/Linux you
  46. # can probably install the software from your package manager.  If you are
  47. # using Debian (or a derivative), try `apt-get install arduino`.  Otherwise,
  48. # you can download the Arduino software manually from http://arduino.cc/.  It
  49. # is suggested that you install it at ~/opt/arduino (or /Applications on OS X)
  50. # if you are unsure.
  51. #
  52. # If you downloaded the Arduino software manually and unpacked it somewhere
  53. # other than ~/opt/arduino (or /Applications), you will need to set up the
  54. # ARDUINODIR environment variable to be the path where you unpacked it.  (If
  55. # unset, ARDUINODIR defaults to some sensible places).  You could set this in
  56. # your ~/.profile by adding something like this:
  57. #
  58. #   export ARDUINODIR=~/somewhere/arduino-1.0
  59. #
  60. # For each project, you will also need to set BOARD to the type of Arduino
  61. # you're building for.  Type `make boards` for a list of acceptable values.
  62. # For example:
  63. #
  64. #   $ export BOARD=uno
  65. #   $ make
  66. #
  67. # You may also need to set SERIALDEV if it is not detected correctly.
  68. #
  69. # The presence of a .ino (or .pde) file causes the arduino.mk to automatically
  70. # determine values for SOURCES, TARGET and LIBRARIES.  Any .c, .cc and .cpp
  71. # files in the project directory (or any "util" or "utility" subdirectories)
  72. # are automatically included in the build and are scanned for Arduino libraries
  73. # that have been #included.  Note, there can only be one .ino (or .pde) file in
  74. # a project directory and if you want to be compatible with the Arduino IDE, it
  75. # should be called the same as the directory name.
  76. #
  77. # Alternatively, if you want to manually specify build variables, create a
  78. # Makefile that defines SOURCES and LIBRARIES and then includes arduino.mk.
  79. # (There is no need to define TARGET).  You can also specify the BOARD here, if
  80. # the project has a specific one.  Here is an example Makefile:
  81. #
  82. #   SOURCES := main.cc other.cc
  83. #   LIBRARIES := EEPROM
  84. #   BOARD := pro5v
  85. #   include ~/src/arduino.mk
  86. #
  87. # Here is a complete list of configuration parameters:
  88. #
  89. # ARDUINODIR   The path where the Arduino software is installed on your system.
  90. #
  91. # ARDUINOCONST The Arduino software version, as an integer, used to define the
  92. #              ARDUINO version constant.  This defaults to 100 if undefined.
  93. #
  94. # AVRDUDECONF  The avrdude.conf to use.  If undefined, this defaults to a guess
  95. #              based on where avrdude is.  If set empty, no avrdude.conf is
  96. #              passed to avrdude (so the system default is used).
  97. #
  98. # AVRDUDEFLAGS Specify any additional flags for avrdude.  The usual flags,
  99. #              required to build the project, will be appended to this.
  100. #
  101. # AVRTOOLSPATH A space-separated list of directories that is searched in order
  102. #              when looking for the avr build tools.  This defaults to PATH,
  103. #              followed by subdirectories in ARDUINODIR.
  104. #
  105. # BOARD        Specify a target board type.  Run `make boards` to see available
  106. #              board types.
  107. #
  108. # CPPFLAGS     Specify any additional flags for the compiler.  The usual flags,
  109. #              required to build the project, will be appended to this.
  110. #
  111. # LINKFLAGS    Specify any additional flags for the linker.  The usual flags,
  112. #              required to build the project, will be appended to this.
  113. #
  114. # LIBRARIES    A list of Arduino libraries to build and include.  This is set
  115. #              automatically if a .ino (or .pde) is found.
  116. #
  117. # LIBRARYPATH  A space-separated list of directories that is searched in order
  118. #              when looking for Arduino libraries.  This defaults to "libs",
  119. #              "libraries" (in the project directory), then your sketchbook
  120. #              "libraries" directory, then the Arduino libraries directory.
  121. #
  122. # SERIALDEV    The POSIX device name of the serial device that is the Arduino.
  123. #              If unspecified, an attempt is made to guess the name of a
  124. #              connected Arduino's serial device, which may work in some cases.
  125. #
  126. # SOURCES      A list of all source files of whatever language.  The language
  127. #              type is determined by the file extension.  This is set
  128. #              automatically if a .ino (or .pde) is found.
  129. #
  130. # TARGET       The name of the target file.  This is set automatically if a
  131. #              .ino (or .pde) is found, but it is not necessary to set it
  132. #              otherwise.
  133. #
  134. # This makefile also defines the following goals for use on the command line
  135. # when you run make:
  136. #
  137. # all          This is the default if no goal is specified.  It builds the
  138. #              target.
  139. #
  140. # target       Builds the target.
  141. #
  142. # upload       Uploads the target (building it, as necessary) to an attached
  143. #              Arduino.
  144. #
  145. # clean        Deletes files created during the build.
  146. #
  147. # boards       Display a list of available board names, so that you can set the
  148. #              BOARD environment variable appropriately.
  149. #
  150. # monitor      Start `screen` on the serial device.  This is meant to be an
  151. #              equivalent to the Arduino serial monitor.
  152. #
  153. # size         Displays size information about the built target.
  154. #
  155. # bootloader   Burns the bootloader for your board to it.
  156. #
  157. # <file>       Builds the specified file, either an object file or the target,
  158. #              from those that that would be built for the project.
  159. #_______________________________________________________________________________
  160. #
  161. PLATFORM  ?= platform
  162. BOARD     ?= mega2560
  163. SERIALDEV ?=/dev/cu.wchusbserial1410
  164. CPPFLAGS  := $(CPPFLAGS) -I./includes -DUSE_MEMBLOCK -DTARGET_ARDUINO \
  165.     -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS
  166. ifeq ($(BOARD), mega2560)
  167. CPPFLAGS := $(CPPFLAGS) -DMAX_BLOCK_COUNT=170
  168. endif
  169.  
  170. # default arduino software directory, check software exists
  171. ifndef ARDUINODIR
  172. ARDUINODIR := $(firstword $(wildcard ~/opt/arduino /usr/share/arduino \
  173.     /Applications/Arduino.app/Contents/Resources/Java \
  174.     $(HOME)/Applications/Arduino.app/Contents/Resources/Java))
  175. endif
  176. ifeq "$(wildcard $(ARDUINODIR)/hardware/arduino/boards.txt)" ""
  177. $(error ARDUINODIR is not set correctly; arduino software not found)
  178. endif
  179.  
  180. # default arduino version
  181. ARDUINOCONST ?= 100
  182.  
  183. # default path for avr tools
  184. AVRTOOLSPATH ?= $(subst :, , $(PATH)) $(ARDUINODIR)/hardware/tools \
  185.     $(ARDUINODIR)/hardware/tools/avr/bin
  186.  
  187. # default path to find libraries
  188. LIBRARYPATH ?= libraries libs $(SKETCHBOOKDIR)/libraries $(ARDUINODIR)/libraries
  189.  
  190. # default serial device to a poor guess (something that might be an arduino)
  191. SERIALDEVGUESS := 0
  192. ifndef SERIALDEV
  193. SERIALDEV := $(firstword $(wildcard \
  194.     /dev/ttyACM? /dev/ttyUSB? /dev/tty.usbserial* /dev/tty.usbmodem*))
  195. SERIALDEVGUESS := 1
  196. endif
  197.  
  198. # no board?
  199. ifndef BOARD
  200. ifneq "$(MAKECMDGOALS)" "boards"
  201. ifneq "$(MAKECMDGOALS)" "clean"
  202. $(error BOARD is unset.  Type 'make boards' to see possible values)
  203. endif
  204. endif
  205. endif
  206.  
  207. # obtain board parameters from the arduino boards.txt file
  208. BOARDSFILE := $(ARDUINODIR)/hardware/arduino/boards.txt
  209. readboardsparam = $(shell sed -ne "s/$(BOARD).$(1)=\(.*\)/\1/p" $(BOARDSFILE))
  210. BOARD_BUILD_MCU := $(call readboardsparam,build.mcu)
  211. BOARD_BUILD_FCPU := $(call readboardsparam,build.f_cpu)
  212. BOARD_BUILD_VARIANT := $(call readboardsparam,build.variant)
  213. BOARD_UPLOAD_SPEED := $(call readboardsparam,upload.speed)
  214. BOARD_UPLOAD_PROTOCOL := $(call readboardsparam,upload.protocol)
  215. BOARD_USB_VID := $(call readboardsparam,build.vid)
  216. BOARD_USB_PID := $(call readboardsparam,build.pid)
  217. BOARD_BOOTLOADER_UNLOCK := $(call readboardsparam,bootloader.unlock_bits)
  218. BOARD_BOOTLOADER_LOCK := $(call readboardsparam,bootloader.lock_bits)
  219. BOARD_BOOTLOADER_LFUSES := $(call readboardsparam,bootloader.low_fuses)
  220. BOARD_BOOTLOADER_HFUSES := $(call readboardsparam,bootloader.high_fuses)
  221. BOARD_BOOTLOADER_EFUSES := $(call readboardsparam,bootloader.extended_fuses)
  222. BOARD_BOOTLOADER_PATH := $(call readboardsparam,bootloader.path)
  223. BOARD_BOOTLOADER_FILE := $(call readboardsparam,bootloader.file)
  224.  
  225. # obtain preferences from the IDE's preferences.txt
  226. PREFERENCESFILE := $(firstword $(wildcard \
  227.     $(HOME)/.arduino/preferences.txt $(HOME)/Library/Arduino/preferences.txt))
  228. ifneq "$(PREFERENCESFILE)" ""
  229. readpreferencesparam = $(shell sed -ne "s/$(1)=\(.*\)/\1/p" $(PREFERENCESFILE))
  230. SKETCHBOOKDIR := $(call readpreferencesparam,sketchbook.path)
  231. endif
  232.  
  233. # invalid board?
  234. ifeq "$(BOARD_BUILD_MCU)" ""
  235. ifneq "$(MAKECMDGOALS)" "boards"
  236. ifneq "$(MAKECMDGOALS)" "clean"
  237. $(error BOARD is invalid.  Type 'make boards' to see possible values)
  238. endif
  239. endif
  240. endif
  241.  
  242. # auto mode?
  243. INOFILE := $(wildcard *.ino *.pde)
  244. ifdef INOFILE
  245. ifneq "$(words $(INOFILE))" "1"
  246. $(error There is more than one .pde or .ino file in this directory!)
  247. endif
  248.  
  249. # automatically determine sources and targeet
  250. TARGET := $(basename $(INOFILE))
  251. SOURCES := $(INOFILE) \
  252.     $(wildcard *.c *.cc *.cpp *.C) \
  253.     $(wildcard $(addprefix util/, *.c *.cc *.cpp *.C)) \
  254.     $(wildcard $(addprefix utility/, *.c *.cc *.cpp *.C))
  255. PNVMSRCS := $(wildcard ./src/*.cpp)
  256. PLATFORM_SRC := platforms/$(PLATFORM).txt
  257. PLATFORM_HEADER := platforms/$(PLATFORM).h
  258. CPPFLAGS := $(CPPFLAGS) -DPLATFORM_HEADER="\"$(PLATFORM_HEADER)\""
  259.  
  260. # automatically determine included libraries
  261. LIBRARIES := $(filter $(notdir $(wildcard $(addsuffix /*, $(LIBRARYPATH)))), \
  262.     $(shell sed -ne "s/^ *\# *include *[<\"]\(.*\)\.h[>\"]/\1/p" $(SOURCES)))
  263.  
  264. endif
  265.  
  266. # software
  267. findsoftware = $(firstword $(wildcard $(addsuffix /$(1), $(AVRTOOLSPATH))))
  268. CC := $(call findsoftware,avr-gcc)
  269. CXX := $(call findsoftware,avr-g++)
  270. LD := $(call findsoftware,avr-ld)
  271. AR := $(call findsoftware,avr-ar)
  272. OBJCOPY := $(call findsoftware,avr-objcopy)
  273. AVRDUDE := $(call findsoftware,avrdude)
  274. AVRSIZE := $(call findsoftware,avr-size)
  275.  
  276. # directories
  277. ARDUINOCOREDIR := $(ARDUINODIR)/hardware/arduino/cores/arduino
  278. LIBRARYDIRS := $(foreach lib, $(LIBRARIES), \
  279.     $(firstword $(wildcard $(addsuffix /$(lib), $(LIBRARYPATH)))))
  280. LIBRARYDIRS += $(addsuffix /utility, $(LIBRARYDIRS))
  281.  
  282. # files
  283. TARGET := $(if $(TARGET),$(TARGET),a.out)
  284. OBJECTS := $(addsuffix .o, $(basename $(SOURCES)))
  285. PNVMOBJS := $(patsubst %, .lib/pnvm/%.o, $(notdir $(basename $(PNVMSRCS))))
  286. DEPFILES := $(patsubst %, .dep/%.dep, $(SOURCES) $(PNVMSRCS))
  287. ARDUINOLIB := .lib/arduino.a
  288. PNVMLIB := .lib/pnvm.a
  289. ARDUINOLIBOBJS := $(foreach dir, $(ARDUINOCOREDIR) $(LIBRARYDIRS), \
  290.     $(patsubst %, .lib/%.o, $(wildcard $(addprefix $(dir)/, *.c *.cpp))))
  291. BOOTLOADERHEX := $(addprefix \
  292.     $(ARDUINODIR)/hardware/arduino/bootloaders/$(BOARD_BOOTLOADER_PATH)/, \
  293.     $(BOARD_BOOTLOADER_FILE))
  294.  
  295. # avrdude confifuration
  296. ifeq "$(AVRDUDECONF)" ""
  297. ifeq "$(AVRDUDE)" "$(ARDUINODIR)/hardware/tools/avr/bin/avrdude"
  298. AVRDUDECONF := $(ARDUINODIR)/hardware/tools/avr/etc/avrdude.conf
  299. else
  300. AVRDUDECONF := $(wildcard $(AVRDUDE).conf)
  301. endif
  302. endif
  303.  
  304. # flags
  305. CPPFLAGS += -Os -Wall -fno-exceptions -ffunction-sections -fdata-sections
  306. CPPFLAGS += -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums
  307. CPPFLAGS += -mmcu=$(BOARD_BUILD_MCU)
  308. CPPFLAGS += -DF_CPU=$(BOARD_BUILD_FCPU) -DARDUINO=$(ARDUINOCONST)
  309. CPPFLAGS += -DUSB_VID=$(BOARD_USB_VID) -DUSB_PID=$(BOARD_USB_PID)
  310. CPPFLAGS += -I. -Iutil -Iutility -I $(ARDUINOCOREDIR)
  311. CPPFLAGS += -I $(ARDUINODIR)/hardware/arduino/variants/$(BOARD_BUILD_VARIANT)/
  312. CPPFLAGS += $(addprefix -I , $(LIBRARYDIRS))
  313. CPPDEPFLAGS = -MMD -MP -MF .dep/$<.dep
  314. CPPINOFLAGS := -x c++ -include $(ARDUINOCOREDIR)/Arduino.h
  315. AVRDUDEFLAGS += $(addprefix -C , $(AVRDUDECONF)) -DV
  316. AVRDUDEFLAGS += -p m328p -P $(SERIALDEV)
  317. AVRDUDEFLAGS += -c arduino -b $(BOARD_UPLOAD_SPEED)
  318. LINKFLAGS += -Os -Wl,--gc-sections -mmcu=$(BOARD_BUILD_MCU)
  319.  
  320. # figure out which arg to use with stty (for OS X, GNU and busybox stty)
  321. STTYFARG := $(shell stty --help 2>&1 | \
  322.     grep -q 'illegal option' && echo -f || echo -F)
  323.  
  324. # include dependencies
  325. ifneq "$(MAKECMDGOALS)" "clean"
  326. -include $(DEPFILES)
  327. endif
  328.  
  329. # default rule
  330. .DEFAULT_GOAL := all
  331.  
  332. #_______________________________________________________________________________
  333. #                                                                          RULES
  334.  
  335. .PHONY: all target upload clean boards monitor size bootloader ctags
  336.  
  337. all: target
  338.  
  339. target: $(PLATFORM_HEADER) $(TARGET).hex
  340.  
  341. upload: target
  342.     @echo "\nUploading to board..."
  343.     @test -n "$(SERIALDEV)" || { \
  344.         echo "error: SERIALDEV could not be determined automatically." >&2; \
  345.         exit 1; }
  346.     @test 0 -eq $(SERIALDEVGUESS) || { \
  347.         echo "*GUESSING* at serial device:" $(SERIALDEV); \
  348.         echo; }
  349. ifeq "$(BOARD_BOOTLOADER_PATH)" "caterina"
  350.     stty $(STTYFARG) $(SERIALDEV) speed 1200
  351.     sleep 1
  352. else
  353.     stty $(STTYFARG) $(SERIALDEV) hupcl
  354. endif
  355.     $(AVRDUDE) $(AVRDUDEFLAGS) -U flash:w:$(TARGET).hex:i
  356.  
  357. clean:
  358.     make -C platforms
  359.     rm -f $(OBJECTS)
  360.     rm -f $(TARGET).elf $(TARGET).hex $(ARDUINOLIB) $(PNVMLIB) *~
  361.     rm -rf .lib .dep
  362.  
  363. boards:
  364.     @echo "Available values for BOARD:"
  365.     @sed -nEe '/^#/d; /^[^.]+\.name=/p' $(BOARDSFILE) | \
  366.         sed -Ee 's/([^.]+)\.name=(.*)/\1            \2/' \
  367.             -e 's/(.{12}) *(.*)/\1 \2/'
  368.  
  369. monitor:
  370.     @test -n "$(SERIALDEV)" || { \
  371.         echo "error: SERIALDEV could not be determined automatically." >&2; \
  372.         exit 1; }
  373.     @test -n `which screen` || { \
  374.         echo "error: can't find GNU screen, you might need to install it." >&2 \
  375.         exit 1; }
  376.     @test 0 -eq $(SERIALDEVGUESS) || { \
  377.         echo "*GUESSING* at serial device:" $(SERIALDEV); \
  378.         echo; }
  379.     screen -L $(SERIALDEV) 9600,ignbrk,-brkint,-imaxbel,-opost,-onlcr,-isig,-icanon,-iexten,-echo,-echoe,-echok,-echoctl,-echoke,noflsh,-ixon,-crtscts
  380.  
  381. size: $(TARGET).elf
  382.     echo && $(AVRSIZE) --format=avr --mcu=$(BOARD_BUILD_MCU) $(TARGET).elf
  383.  
  384. bootloader:
  385.     @echo "Burning bootloader to board..."
  386.     @test -n "$(SERIALDEV)" || { \
  387.         echo "error: SERIALDEV could not be determined automatically." >&2; \
  388.         exit 1; }
  389.     @test 0 -eq $(SERIALDEVGUESS) || { \
  390.         echo "*GUESSING* at serial device:" $(SERIALDEV); \
  391.         echo; }
  392.     stty $(STTYFARG) $(SERIALDEV) hupcl
  393.     $(AVRDUDE) $(AVRDUDEFLAGS) -U lock:w:$(BOARD_BOOTLOADER_UNLOCK):m
  394.     $(AVRDUDE) $(AVRDUDEFLAGS) -eU lfuse:w:$(BOARD_BOOTLOADER_LFUSES):m
  395.     $(AVRDUDE) $(AVRDUDEFLAGS) -U hfuse:w:$(BOARD_BOOTLOADER_HFUSES):m
  396. ifneq "$(BOARD_BOOTLOADER_EFUSES)" ""
  397.     $(AVRDUDE) $(AVRDUDEFLAGS) -U efuse:w:$(BOARD_BOOTLOADER_EFUSES):m
  398. endif
  399. ifneq "$(BOOTLOADERHEX)" ""
  400.     $(AVRDUDE) $(AVRDUDEFLAGS) -U flash:w:$(BOOTLOADERHEX):i
  401. endif
  402.     $(AVRDUDE) $(AVRDUDEFLAGS) -U lock:w:$(BOARD_BOOTLOADER_LOCK):m
  403.  
  404. # building the target
  405.  
  406. $(TARGET).hex: $(TARGET).elf
  407.     $(OBJCOPY) -O ihex -R .eeprom $< $@
  408.  
  409. .INTERMEDIATE: $(TARGET).elf
  410.  
  411. $(TARGET).elf: $(ARDUINOLIB) $(PNVMLIB) $(OBJECTS)
  412.     $(CXX) $(LINKFLAGS) $(OBJECTS) $(PNVMLIB) $(ARDUINOLIB) -lm -o $@
  413.  
  414. %.o: %.c
  415.     mkdir -p .dep/$(dir $<)
  416.     $(CXX) -c $(CPPFLAGS) $(CPPDEPFLAGS) -o $@ $<
  417.  
  418. %.o: %.cpp
  419.     mkdir -p .dep/$(dir $<)
  420.     $(COMPILE.cpp) $(CPPDEPFLAGS) -o $@ $<
  421.  
  422. %.o: %.cc
  423.     mkdir -p .dep/$(dir $<)
  424.     $(COMPILE.cpp) $(CPPDEPFLAGS) -o $@ $<
  425.  
  426. %.o: %.C
  427.     mkdir -p .dep/$(dir $<)
  428.     $(COMPILE.cpp) $(CPPDEPFLAGS) -o $@ $<
  429.  
  430. %.o: %.ino
  431.     mkdir -p .dep/$(dir $<)
  432.     $(COMPILE.cpp) $(CPPDEPFLAGS) -o $@ $(CPPINOFLAGS) $<
  433.  
  434. %.o: %.pde
  435.     mkdir -p .dep/$(dir $<)
  436.     $(COMPILE.cpp) $(CPPDEPFLAGS) -o $@ $(CPPINOFLAGS) $<
  437.  
  438. # building the pnvm library
  439. $(PNVMLIB): $(PNVMOBJS)
  440.     $(AR) rcs $@ $?
  441.  
  442. # building the arduino library
  443. $(ARDUINOLIB): $(ARDUINOLIBOBJS)
  444.     $(AR) rcs $@ $?
  445.  
  446. .lib/pnvm/%.o: ./src/%.cpp
  447.     mkdir -p $(dir $@)
  448.     $(COMPILE.cpp) -o $@ $<
  449.  
  450. .lib/%.c.o: %.c
  451.     mkdir -p $(dir $@)
  452.     $(COMPILE.c) -o $@ $<
  453.  
  454. .lib/%.cpp.o: %.cpp
  455.     mkdir -p $(dir $@)
  456.     $(COMPILE.cpp) -o $@ $<
  457.  
  458. .lib/%.cc.o: %.cc
  459.     mkdir -p $(dir $@)
  460.     $(COMPILE.cpp) -o $@ $<
  461.  
  462. .lib/%.C.o: %.C
  463.     mkdir -p $(dir $@)
  464.     $(COMPILE.cpp) -o $@ $<
  465.  
  466. platforms/%.h: platforms/%.txt
  467.     make -C platforms
  468.  
  469. ctags:
  470.     ctags -R . ../includes ./src $(ARDUINOCOREDIR)
  471.  
  472. # Local Variables:
  473. # mode: makefile
  474. # tab-width: 4
  475. # End:
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement