--- /dev/null
+# ATmega328P, shitty Chinese arduino clone (just an atmega328p with arduino bootloader/flasher)
+
+MCU = attiny25
+F_CPU = 8000000UL
+BAUD = 57600
+
+PROGRAMMER_TYPE = arduino
+
+CC = avr-gcc
+OBJCOPY = avr-objcopy
+OBJDUMP = avr-objdump
+AVRSIZE = avr-size
+AVRDUDE = avrdude
+
+CPPFLAGS = -DF_CPU=$(F_CPU) -DBAUD=$(BAUD) -I.
+CFLAGS = -Os -g -Wall
+CFLAGS += -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums
+
+LDFLAGS = -Wl,-Map,hbc.map
+TARGET_ARCH = -mmcu=$(MCU)
+
+DEPS =
+
+ODIR = obj
+_OBJ = hbc.o
+OBJ = $(patsubst %, $(ODIR)/%,$(_OBJ))
+
+$(ODIR)/%.o: %.c $(DEPS)
+ @mkdir -p $(@D)
+ $(CC) -c $(CFLAGS) $(CPPFLAGS) $(TARGET_ARCH) $< -o $@
+
+%.elf: $(OBJ)
+ $(CC) $(LDFLAGS) $(TARGET_ARCH) $^ -o $@
+
+%.hex: %.elf
+ $(OBJCOPY) -j .text -j .data -O ihex $< $@
+
+all: hbc.hex
+
+.PHONY: clean
+
+clean:
+ rm -rf $(ODIR)/*.o *.hex *.elf *.map
+
+
+check-dev:
+ $(AVRDUDE) -p m328p -c $(PROGRAMMER_TYPE) -b $(BAUD) -P /dev/ttyUSB0
+
+flash:
+ $(AVRDUDE) -p m328p -c $(PROGRAMMER_TYPE) -b $(BAUD) -P /dev/ttyUSB0 -U flash:w:flash.hex:i
+
+read-flash-bin:
+ $(AVRDUDE) -p m328p -c $(PROGRAMMER_TYPE) -b $(BAUD) -P /dev/ttyUSB0 -U flash:r:flash.bin:r
+