-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathMakefile
More file actions
41 lines (32 loc) · 767 Bytes
/
Makefile
File metadata and controls
41 lines (32 loc) · 767 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# commands
CC := gcc
CFLAG := -O3 -Wall
RM := rm -rf
# target and source
TARGET := stm32isp
OBJS := main.o hexfile.o memmap.o serial.o stm32.o term.o
# All Target
all: $(TARGET)
# deps
hexfile.o : hexfile.c hexfile.h memmap.h
main.o : main.c stm32.h hexfile.h memmap.h term.h
memmap.o : memmap.h
serial.o : serial.h
stm32.o : stm32.h serial.h memmap.h
term.o : term.h serial.h stm32.h
# Tool invocations
stm32isp: $(OBJS)
$(CC) -o $@ $(OBJS)
%.o: %.c
$(CC) $(CFLAG) -c -o $@ $<
# test
test: $(TARGET)
./$(TARGET) -term 9600 -verbose -bootp RTS -reset DTR blink.hex /dev/tty.usbserial-AE01DHMV 115200
# install
install: $(TARGET)
sudo cp $(TARGET) /usr/local/bin
# Other Targets
clean:
-$(RM) $(OBJS) $(TARGET)
.PHONY: all clean dependents
.SECONDARY: