blob: 96f6a4f6e8096c80352bb0fa9b4c6c2449ce4480 (
plain)
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
|
.DEFAULT_GOAL := all
override CFLAGS += -O2 -Wall -I.
OBJS = pflash.o progress.o version.o
LIBFLASH_OBJS += libflash-libflash.o libflash-libffs.o libflash-ecc.o libflash-blocklevel.o libflash-file.o
OBJS += $(LIBFLASH_OBJS)
OBJS += common-arch_flash.o
EXE = pflash
CC = $(CROSS_COMPILE)gcc
PFLASH_VERSION ?= $(shell ./make_version.sh $(EXE))
version.c: make_version.sh .version
@(if [ "a$(PFLASH_VERSION)" = "a" ]; then \
echo "#error You need to set PFLASH_VERSION environment variable" > $@ ;\
else \
echo "const char version[] = \"$(PFLASH_VERSION)\";" ;\
fi) > $@
%.o : %.c
$(CC) $(CFLAGS) -c $< -o $@
$(LIBFLASH_OBJS): libflash-%.o : libflash/%.c
$(CC) $(CFLAGS) -c $< -o $@
$(EXE): $(OBJS)
$(CC) $(CFLAGS) $^ -lrt -o $@
|