forked from eerimoq/detools
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
48 lines (40 loc) · 1.07 KB
/
Makefile
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
CC = $(CROSS_COMPILE)gcc
AR = $(CROSS_COMPILE)ar
# Install prefix.
PREFIX ?= /usr/local
OPT ?= -O2
CFLAGS += -g
CFLAGS += -Wall
CFLAGS += -Wextra
CFLAGS += -Wdouble-promotion
CFLAGS += -Wfloat-equal
CFLAGS += -Wformat=2
CFLAGS += -Wshadow
CFLAGS += -Werror
CFLAGS += -std=c99
CFLAGS += $(OPT)
CFLAGS += -Iheatshrink
CFLAGS += $(CFLAGS_EXTRA)
SRC += heatshrink/heatshrink_decoder.c
SRC += detools.c
SRC += main.c
all:
$(CC) $(CFLAGS) $(SRC) -llzma -o detools
clean:
rm -f detools detools.o libdetools.a esp8266-20190125-v1.10.bin
test: all
./detools apply_patch \
../tests/files/micropython/esp8266-20180511-v1.9.4.bin \
../tests/files/micropython/esp8266-20180511-v1.9.4--20190125-v1.10-heatshrink.patch \
esp8266-20190125-v1.10.bin
cmp \
esp8266-20190125-v1.10.bin \
../tests/files/micropython/esp8266-20190125-v1.10.bin
library:
$(CC) $(CFLAGS) detools.c -c -o detools.o
$(AR) cr libdetools.a detools.o
install:
mkdir -p $(PREFIX)/include
install -c -m 644 detools.h $(PREFIX)/include
mkdir -p $(PREFIX)/lib
install -c -m 644 libdetools.a $(PREFIX)/lib