diff options
author | lonkaars <loek@pipeframe.xyz> | 2022-04-26 12:39:22 +0200 |
---|---|---|
committer | lonkaars <loek@pipeframe.xyz> | 2022-04-26 12:39:22 +0200 |
commit | d067eacc112f2453e95f0dde89bb0f60f170a195 (patch) | |
tree | a8066fb861ecaa2162e6e9683fb201d4e1600fe7 /makefile | |
parent | 8db9589e6ca1757a5c5224fe5b913828d9ec0cb3 (diff) |
project restructure + help in readme.md
Diffstat (limited to 'makefile')
-rw-r--r-- | makefile | 44 |
1 files changed, 5 insertions, 39 deletions
@@ -1,42 +1,8 @@ -DEVICE = atmega328p -MCU = atmega328p -AVRDUDE_DEVICE = m328p -DEVICE ?= atmega168 -MCU ?= atmega168 -AVRDUDE_DEVICE ?= m168 +SUBDIRS := client robot -CFLAGS=-g -Wall -mcall-prologues -mmcu=$(MCU) $(DEVICE_SPECIFIC_CFLAGS) -Os -LDFLAGS=-Wl,-gc-sections -lpololu_$(DEVICE) -Wl,-relax +all clean format compile_commands: $(SUBDIRS) FORCE -PORT ?= /dev/ttyACM0 +$(SUBDIRS): FORCE + $(MAKE) -C $@ $(MAKECMDGOALS) -SOURCES := $(wildcard *.c) -HEADERS := $(wildcard *.h) -OBJECTS := $(patsubst %.c,%.o, $(SOURCES)) - -AVRDUDE=avrdude -CC=avr-gcc -OBJ2HEX=avr-objcopy - -all: out.hex - -clean: - rm -f *.o out.hex a.out compile_commands.json - -a.out: $(OBJECTS) - $(CC) $(OBJECTS) $(CFLAGS) $(LDFLAGS) - -.o: - $(CC) -c $(CFLAGS) $< - -out.hex: a.out - $(OBJ2HEX) -R .eeprom -O ihex $< $@ - -flash: out.hex - $(AVRDUDE) -p $(AVRDUDE_DEVICE) -c avrisp2 -P $(PORT) -U flash:w:out.hex - -format: - clang-format -i $(SOURCES) $(HEADERS) - -compile_commands: clean - bear -- make +FORCE:
\ No newline at end of file |