Kaynağa Gözat

Makefile: generic pde=>cpp rule

This adds flexibility to the makefile by allowing different pde
targets to be specified for different needs.
Phil Hord 13 yıl önce
ebeveyn
işleme
245dca4bee
1 değiştirilmiş dosya ile 7 ekleme ve 5 silme
  1. 7
    5
      Marlin/Makefile

+ 7
- 5
Marlin/Makefile Dosyayı Görüntüle

@@ -138,6 +138,8 @@ all: build sizeafter
138 138
 build: elf hex 
139 139
 
140 140
 applet/$(TARGET).cpp: $(TARGET).pde $(MAKEFILE)
141
+
142
+applet/%.cpp: %.pde
141 143
 # Here is the "preprocessing".
142 144
 # It creates a .cpp file based with the same name as the .pde file.
143 145
 # On top of the new .cpp file comes the WProgram.h header.
@@ -145,11 +147,11 @@ applet/$(TARGET).cpp: $(TARGET).pde $(MAKEFILE)
145 147
 # Then the .cpp file will be compiled. Errors during compile will
146 148
 # refer to this new, automatically generated, file. 
147 149
 # Not the original .pde file you actually edit...
148
-	@echo "  WR    applet/$(TARGET).cpp"
149
-	@test -d applet || mkdir applet
150
-	@echo '#include "WProgram.h"' > applet/$(TARGET).cpp
151
-	@cat $(TARGET).pde >> applet/$(TARGET).cpp
152
-	@cat $(ARDUINO)/main.cpp >> applet/$(TARGET).cpp
150
+	@echo "  WR    $@"
151
+	@test -d $(dir $@) || mkdir $(dir $@)
152
+	@echo '#include "WProgram.h"' > $@
153
+	@cat $< >> $@
154
+	@cat $(ARDUINO)/main.cpp >> $@
153 155
 
154 156
 elf: applet/$(TARGET).elf
155 157
 hex: applet/$(TARGET).hex

Loading…
İptal
Kaydet