-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
46 lines (34 loc) · 964 Bytes
/
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
CC = gcc
AR = ar rcv
ifeq ($(windir),)
EXE =
RM = rm -f
else
EXE = .exe
RM = del
endif
CFLAGS = -ffunction-sections -O3
LDFLAGS = -Wl,--gc-sections
all: libmincrypt.a mkbootimg unpackbootimg mkbootfs dtbToolCM
libmincrypt.a:
make -C libmincrypt
mkbootfs$(EXE):mkbootfs.o
$(CC) -o $@ $^ -L. $(LDFLAGS) -static -s
.c.o:
$(CC) -o $@ $(CFLAGS) -c $< -I. -Werror
mkbootimg: mkbootimg.o
$(CC) -o $@ $^ -L. -lmincrypt $(LDFLAGS) -s
mkbootimg-static$(EXE):mkbootimg.o
$(CC) -o $@ $^ -L. -lmincrypt -static
mkbootimg.o: mkbootimg.c
$(CC) -o $@ $(CFLAGS) -c $< -I.
unpackbootimg: unpackbootimg.o
$(CC) -o $@ $^ $(LDFLAGS) -static -s
unpackbootimg-static$(EXE):unpackbootimg.o
$(CC) -o $@ $^ -static
unpackbootimg.o: unpackbootimg.c
$(CC) -o $@ $(CFLAGS) -c $<
clean:
$(RM) mkbootimg mkbootimg-static mkbootimg.o unpackbootimg unpackbootimg-static unpackbootimg.o mkbootfs mkbootfs.o dtbToolCM
$(RM) libmincrypt.a Makefile.~
make -C libmincrypt clean