X-Git-Url: https://git.realraum.at/?p=svn42.git;a=blobdiff_plain;f=rf433ctl%2FMakefile;h=617684b61ee81f5ead45e9f22e0732f07aa766ab;hp=ec00211c4e60a4b90de67e8407ba38d46da2b345;hb=a34e51d757fe52cb19de2937ae1b211894167524;hpb=b654506283c4f625e5ade66e2bc5eb22ad4d1545 diff --git a/rf433ctl/Makefile b/rf433ctl/Makefile index ec00211..617684b 100755 --- a/rf433ctl/Makefile +++ b/rf433ctl/Makefile @@ -1,23 +1,30 @@ ## see README file TARGET = rf433ctl -INSTALL_DIR = /home/equinox/realraum/rf433ctl/arduino +#TARGET = find_onewire +INSTALL_DIR = $(PWD)/arduino PORT = /dev/ttyUSB0 UPLOAD_RATE = 57600 AVRDUDE_PROGRAMMER = stk500v1 MCU = atmega328p +# standard | micro | mega | leonardo | eightanaloginputs +VARIANT=standard F_CPU = 16000000 ############################################################################ # Below here nothing should be changed... -ARDUINO = $(INSTALL_DIR)/hardware/cores/arduino +RESET_TTY_DIR=../reset_tty/ +RESET_TTY=$(RESET_TTY_DIR)reset_tty +ARDUINO = $(INSTALL_DIR)/hardware/arduino +ARDUINOCORE = $(ARDUINO)/cores/arduino +ARDUINOVAR = $(ARDUINO)/variants/$(VARIANT) AVR_TOOLS_PATH = /usr/bin -SRC = $(ARDUINO)/pins_arduino.c $(ARDUINO)/wiring.c \ -$(ARDUINO)/wiring_analog.c $(ARDUINO)/wiring_digital.c \ -$(ARDUINO)/wiring_pulse.c $(ARDUINO)/wiring_serial.c \ -$(ARDUINO)/wiring_shift.c $(ARDUINO)/WInterrupts.c -CXXSRC = $(ARDUINO)/HardwareSerial.cpp $(ARDUINO)/Print.cpp $(ARDUINO)/WMath.cpp +SRC = $(ARDUINOCORE)/wiring.c \ +$(ARDUINOCORE)/wiring_analog.c $(ARDUINOCORE)/wiring_digital.c \ +$(ARDUINOCORE)/wiring_pulse.c \ +$(ARDUINOCORE)/wiring_shift.c $(ARDUINOCORE)/WInterrupts.c +CXXSRC = $(ARDUINOCORE)/new.cpp $(ARDUINOCORE)/WString.cpp OneWire/OneWire.cpp DallasTemperature/DallasTemperature.cpp $(ARDUINOCORE)/HardwareSerial.cpp $(ARDUINOCORE)/Print.cpp $(ARDUINOCORE)/WMath.cpp IRremote/IRremote.cpp FORMAT = ihex @@ -36,22 +43,24 @@ CDEFS = -DF_CPU=$(F_CPU) CXXDEFS = -DF_CPU=$(F_CPU) # Place -I options here -CINCS = -I$(ARDUINO) -CXXINCS = -I$(ARDUINO) +CINCS = -I ./OneWire -I ./DallasTemperature -I ./IRremote -I$(ARDUINOCORE) -I $(ARDUINOVAR) +CXXINCS = -I ./OneWire -I ./DallasTemperature -I ./IRremote -I$(ARDUINOCORE) -I $(ARDUINOVAR) # Compiler flag to set the C Standard level. # c89 - "ANSI" C # gnu89 - c89 plus GCC extensions # c99 - ISO C99 standard (not yet fully implemented) # gnu99 - c99 plus GCC extensions -CSTANDARD = -std=gnu99 +#CSTANDARD = -std=gnu99 +CSTANDARD = CDEBUG = -g$(DEBUG) -CWARN = -Wall -Wstrict-prototypes +#CWARN = -Wall -Wstrict-prototypes +CWARN = -Wall CTUNING = -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums #CEXTRA = -Wa,-adhlns=$(<:.c=.lst) CFLAGS = $(CDEBUG) $(CDEFS) $(CINCS) -O$(OPT) $(CWARN) $(CSTANDARD) $(CEXTRA) -CXXFLAGS = $(CDEFS) $(CINCS) -O$(OPT) +CXXFLAGS = $(CDEFS) $(CXXINCS) -O$(OPT) #ASFLAGS = -Wa,-adhlns=$(<:.S=.lst),-gstabs LDFLAGS = -lm @@ -71,7 +80,8 @@ OBJDUMP = $(AVR_TOOLS_PATH)/avr-objdump AR = $(AVR_TOOLS_PATH)/avr-ar SIZE = $(AVR_TOOLS_PATH)/avr-size NM = $(AVR_TOOLS_PATH)/avr-nm -AVRDUDE = $(AVR_TOOLS_PATH)/avrdude +#AVRDUDE = $(AVR_TOOLS_PATH)/avrdude +AVRDUDE = $(INSTALL_DIR)/hardware/tools/avrdude REMOVE = rm -f MV = mv -f @@ -96,15 +106,14 @@ build: elf hex applet_files: $(TARGET).pde # Here is the "preprocessing". # 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. # At the end there is a generic main() function attached. # Then the .cpp file will be compiled. Errors during compile will # refer to this new, automatically generated, file. # Not the original .pde file you actually edit... test -d applet || mkdir applet - echo '#include "WProgram.h"' > applet/$(TARGET).cpp + echo '#include ' > applet/$(TARGET).cpp cat $(TARGET).pde >> applet/$(TARGET).cpp - cat $(ARDUINO)/main.cxx >> applet/$(TARGET).cpp + cat $(ARDUINOCORE)/main.cpp >> applet/$(TARGET).cpp elf: applet/$(TARGET).elf hex: applet/$(TARGET).hex @@ -113,7 +122,8 @@ lss: applet/$(TARGET).lss sym: applet/$(TARGET).sym # Program the device. -upload: applet/$(TARGET).hex +upload: applet/$(TARGET).hex $(RESET_TTY) + $(RESET_TTY) $(PORT) $(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) @@ -191,7 +201,7 @@ applet/core.a: $(OBJ) # Target: clean project. clean: - $(REMOVE) applet/$(TARGET).hex applet/$(TARGET).eep applet/$(TARGET).cof applet/$(TARGET).elf \ + $(REMOVE) applet/$(TARGET).cpp applet/$(TARGET).hex applet/$(TARGET).eep applet/$(TARGET).cof applet/$(TARGET).elf \ applet/$(TARGET).map applet/$(TARGET).sym applet/$(TARGET).lss applet/core.a \ $(OBJ) $(LST) $(SRC:.c=.s) $(SRC:.c=.d) $(CXXSRC:.cpp=.s) $(CXXSRC:.cpp=.d) @@ -206,4 +216,7 @@ depend: >> $(MAKEFILE); \ $(CC) -M -mmcu=$(MCU) $(CDEFS) $(CINCS) $(SRC) $(ASRC) >> $(MAKEFILE) +$(RESET_TTY): + make -C $(RESET_TTY_DIR) + .PHONY: all build elf hex eep lss sym program coff extcoff clean depend applet_files sizebefore sizeafter