forked from mmozeiko/pkg2zip
-
Notifications
You must be signed in to change notification settings - Fork 36
/
Copy pathmakefile
59 lines (45 loc) · 1.12 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
ifeq ($(OS),Windows_NT)
RM := del /q
EXE := .exe
else
EXE :=
endif
DESTDIR =
PREFIX = /usr/local
BINDIR = $(PREFIX)/bin
BIN = pkg2zip${EXE}
SRC = ${wildcard pkg2zip*.c} miniz_tdef.c puff.c
OBJ = ${SRC:.c=.o}
DEP = ${SRC:.c=.d}
CFLAGS = -std=c99 -pipe -fvisibility=hidden -Wall -Wextra -Werror -DNDEBUG -D_GNU_SOURCE -O2
${BIN}: LDFLAGS += -s
debug: CFLAGS += -g
debug: LDFLAGS += -g
.PHONY: all clean
all: ${BIN}
install:
install -D -m 0755 ${BIN} $(DESTDIR)$(BINDIR)/${BIN}
install -D -m 0755 rif2zrif.py $(DESTDIR)$(BINDIR)/rif2zrif
install -D -m 0755 zrif2rif.py $(DESTDIR)$(BINDIR)/zrif2rif
uninstall:
rm -f $(DESTDIR)$(BINDIR)/${BIN}
rm -f $(DESTDIR)$(BINDIR)/rif2zrif
rm -f $(DESTDIR)$(BINDIR)/zrif2rif
clean:
@${RM} ${BIN} ${OBJ} ${DEP}
${BIN}: ${OBJ}
@echo [L] $@
@${CC} ${LDFLAGS} -o $@ $^
debug: ${OBJ}
@echo [L] ${BIN}
@${CC} ${LDFLAGS} -o ${BIN} $^
%aes_x86.o: %aes_x86.c
@echo [C] $<
@${CC} ${CFLAGS} -maes -mssse3 -MMD -c -o $@ $<
%crc32_x86.o: %crc32_x86.c
@echo [C] $<
@${CC} ${CFLAGS} -mpclmul -msse4 -MMD -c -o $@ $<
%.o: %.c
@echo [C] $<
@${CC} ${CFLAGS} -MMD -c -o $@ $<
-include ${DEP}