wiring-sucks

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README

commit 25cd076cac2fd204793aaed4475e421e08e9f923
parent 7b8a595310eec30084332689c7d7a7a7482263c6
Author: Elecon-rou <quest90spin@gmail.com>
Date:   Fri, 24 Mar 2017 03:14:42 +0300

Switch to mk instead of GNU make; Fix README

Diffstat:
DMakefile | 45---------------------------------------------
MREADME.md | 4++--
Mconfig.mk | 8++++----
Amkfile | 55+++++++++++++++++++++++++++++++++++++++++++++++++++++++
Rwiring_pulse.S -> wiring_pulse_asm.S | 0
5 files changed, 61 insertions(+), 51 deletions(-)

diff --git a/Makefile b/Makefile @@ -1,45 +0,0 @@ -include config.mk - -OBJS = \ -abi.o \ -CDC.o \ -HardwareSerial.o \ -HardwareSerial0.o \ -HardwareSerial1.o \ -HardwareSerial2.o \ -HardwareSerial3.o \ -hooks.o \ -IPAddress.o \ -main.o \ -new.o \ -PluggableUSB.o \ -Print.o \ -Stream.o \ -Tone.o \ -USBCore.o \ -WInterrupts.o \ -wiring_analog.o \ -wiring.o \ -wiring_digital.o \ -wiring_pulse.o \ -wiring_shift.o \ -WMath.o \ -WString.o \ -program.o \ - -%.o : %.S - $(CC) -x assembler-with-cpp -c -o $@ $< -%.o : %.cpp - $(CXX) -c -o $@ $< -%.o : %.c - $(CC) -c -o $@ $< - -applet: $(OBJS) - $(CXX) $^ -o $@.o - $(OBJCOPY) $@.o $@.bin - -flash: - avrdude -p m328p -c arduino -P $(SERIAL) -U flash:w:applet.bin - -clean: - rm -f applet.bin *.o diff --git a/README.md b/README.md @@ -5,8 +5,8 @@ Build Wiring programs for Arduino without any IDE * Set for your device with ```$ git branch```. Default is Arduino Uno R3 * Write your program in ```program.cpp``` * Edit ```config.mk``` to specify port and other settings -* ```$ make``` to build -* ```# make flash``` to flash your Arduino +* ```$ mk``` to build +* ```# mk flash``` to flash your Arduino ## Requirements AVR Toolchain: avr-gcc, avr-g++, avr-libc, avrdude diff --git a/config.mk b/config.mk @@ -1,9 +1,9 @@ MCU=atmega328p -SERIAL= /dev/ttyACM0 +SERIAL=/dev/ttyACM0 -CFLAGS= -Os -mmcu=$(MCU) -I. -Iinclude -DF_CPU=16000000L +CFLAGS=-Os -mmcu=$MCU -I. -Iinclude -DF_CPU=16000000L -CC=avr-gcc $(CFLAGS) -CXX=avr-g++ $(CFLAGS) +CC=avr-gcc $CFLAGS +CXX=avr-g++ $CFLAGS OBJCOPY=avr-objcopy -j .text -j .data -O ihex \ No newline at end of file diff --git a/mkfile b/mkfile @@ -0,0 +1,54 @@ +<config.mk + +OBJS = \ +abi.o \ +CDC.o \ +HardwareSerial.o \ +HardwareSerial0.o \ +HardwareSerial1.o \ +HardwareSerial2.o \ +HardwareSerial3.o \ +hooks.o \ +IPAddress.o \ +main.o \ +new.o \ +PluggableUSB.o \ +Print.o \ +Stream.o \ +Tone.o \ +USBCore.o \ +WInterrupts.o \ +wiring_analog.o \ +wiring.o \ +wiring_digital.o \ +wiring_pulse.o \ +wiring_pulse_asm.o \ +wiring_shift.o \ +WMath.o \ +WString.o \ +program.o \ + +all:V: applet.bin + +%.o : %.S + $CC -x assembler-with-cpp -c $stem.S +%.o : %.cpp + $CXX -c $stem.cpp +%.o : %.c + $CC -c $stem.c + +applet.o : $OBJS + $CXX $prereq -o $target + +applet.bin : applet.o + $OBJCOPY $prereq $target + +flash:V: applet.bin + avrdude -p m328p -c arduino -P $SERIAL -U flash:w:$target + +clean:V: + rm -f *.o + +nuke:V: clean + rm -f applet.bin + + \ No newline at end of file diff --git a/wiring_pulse.S b/wiring_pulse_asm.S