-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
64 lines (55 loc) · 1.63 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# XCBackup Makefile
CONFIG=-D_GNU_SOURCE -DENABLE_ENCRYPTION -DENABLE_STDIN_PASSWORD
INCLUDES=-I include $(CONFIG)
INDENT_FLAGS=-br -ce -i4 -bl -bli0 -bls -c4 -cdw -ci4 -cs -nbfda -l100 -lp -prs -nlp -nut -nbfde -npsl -nss
LIBS=-lmbedcrypto
OBJS = \
bin/main.o \
bin/unpack.o \
bin/pack.o \
bin/stream.o \
bin/files.o \
bin/util.o \
bin/file.o \
bin/buffer.o \
bin/aes.o
all: host
internal: prepare
@echo " CC src/aes.c"
@$(CC) $(CFLAGS) $(INCLUDES) src/aes.c -o bin/aes.o
@echo " CC src/file.c"
@$(CC) $(CFLAGS) $(INCLUDES) src/file.c -o bin/file.o
@echo " CC src/buffer.c"
@$(CC) $(CFLAGS) $(INCLUDES) src/buffer.c -o bin/buffer.o
@echo " CC src/main.c"
@$(CC) $(CFLAGS) $(INCLUDES) src/main.c -o bin/main.o
@echo " CC src/unpack.c"
@$(CC) $(CFLAGS) $(INCLUDES) src/unpack.c -o bin/unpack.o
@echo " CC src/pack.c"
@$(CC) $(CFLAGS) $(INCLUDES) src/pack.c -o bin/pack.o
@echo " CC src/stream.c"
@$(CC) $(CFLAGS) $(INCLUDES) src/stream.c -o bin/stream.o
@echo " CC src/files.c"
@$(CC) $(CFLAGS) $(INCLUDES) src/files.c -o bin/files.o
@echo " CC src/util.c"
@$(CC) $(CFLAGS) $(INCLUDES) src/util.c -o bin/util.o
@echo " LD bin/xcbackup"
@$(LD) -o bin/xcbackup $(OBJS) $(LDFLAGS) $(LIBS)
prepare:
@mkdir -p bin
host:
@make internal \
CC=gcc \
LD=gcc \
CFLAGS='-c -Wall -Wextra -O2 -ffunction-sections -fdata-sections -Wstrict-prototypes' \
LDFLAGS='-s -Wl,--gc-sections -Wl,--relax'
indent:
@indent $(INDENT_FLAGS) ./*/*.h
@indent $(INDENT_FLAGS) ./*/*.c
@rm -rf ./*/*~
clean:
@rm -rf bin
install:
@cp -v bin/xcbackup /usr/bin/xcbackup
uninstall:
@rm -fv /usr/bin/xcbackup