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 42 43 44 45 46 47 48
|
PREFIX = /usr/local
CFLAGS += -Wall -g
ifndef CC
$(error CC is not defined)
endif
ifndef AR
$(error AR is not defined)
endif
INSTALL = install
OBJS = dev_table.o \
i2c.o \
init.o \
main.o \
port.o \
serial_common.o \
serial_platform.o \
stm32.o \
utils.o
LIBOBJS = parsers/parsers.a
all: stm32flash
serial_platform.o: serial_posix.c serial_w32.c
parsers/parsers.a: force
cd parsers && $(MAKE) parsers.a
stm32flash: $(OBJS) $(LIBOBJS)
$(CC) $(LDFLAGS) -o $@ $(OBJS) $(LIBOBJS)
clean:
rm -f $(OBJS) stm32flash
cd parsers && $(MAKE) $@
install: all
$(INSTALL) -d $(DESTDIR)$(PREFIX)/bin
$(INSTALL) -m 755 stm32flash $(DESTDIR)$(PREFIX)/bin
$(INSTALL) -d $(DESTDIR)$(PREFIX)/share/man/man1
$(INSTALL) -m 644 stm32flash.1 $(DESTDIR)$(PREFIX)/share/man/man1
force:
.PHONY: all clean install force
|