sunu

arduino editor makefile

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