Makefile: generic pde=>cpp rule
This adds flexibility to the makefile by allowing different pde targets to be specified for different needs.
This commit is contained in:
parent
27f595a444
commit
245dca4bee
1 changed files with 7 additions and 5 deletions
|
@ -138,6 +138,8 @@ all: build sizeafter
|
||||||
build: elf hex
|
build: elf hex
|
||||||
|
|
||||||
applet/$(TARGET).cpp: $(TARGET).pde $(MAKEFILE)
|
applet/$(TARGET).cpp: $(TARGET).pde $(MAKEFILE)
|
||||||
|
|
||||||
|
applet/%.cpp: %.pde
|
||||||
# Here is the "preprocessing".
|
# Here is the "preprocessing".
|
||||||
# It creates a .cpp file based with the same name as the .pde file.
|
# It creates a .cpp file based with the same name as the .pde file.
|
||||||
# On top of the new .cpp file comes the WProgram.h header.
|
# On top of the new .cpp file comes the WProgram.h header.
|
||||||
|
@ -145,11 +147,11 @@ applet/$(TARGET).cpp: $(TARGET).pde $(MAKEFILE)
|
||||||
# Then the .cpp file will be compiled. Errors during compile will
|
# Then the .cpp file will be compiled. Errors during compile will
|
||||||
# refer to this new, automatically generated, file.
|
# refer to this new, automatically generated, file.
|
||||||
# Not the original .pde file you actually edit...
|
# Not the original .pde file you actually edit...
|
||||||
@echo " WR applet/$(TARGET).cpp"
|
@echo " WR $@"
|
||||||
@test -d applet || mkdir applet
|
@test -d $(dir $@) || mkdir $(dir $@)
|
||||||
@echo '#include "WProgram.h"' > applet/$(TARGET).cpp
|
@echo '#include "WProgram.h"' > $@
|
||||||
@cat $(TARGET).pde >> applet/$(TARGET).cpp
|
@cat $< >> $@
|
||||||
@cat $(ARDUINO)/main.cpp >> applet/$(TARGET).cpp
|
@cat $(ARDUINO)/main.cpp >> $@
|
||||||
|
|
||||||
elf: applet/$(TARGET).elf
|
elf: applet/$(TARGET).elf
|
||||||
hex: applet/$(TARGET).hex
|
hex: applet/$(TARGET).hex
|
||||||
|
|
Reference in a new issue