-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
37 lines (27 loc) · 804 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
BUILD ?= obj
CFLAGS += -Iinclude
all: libhjbcrypt.so attack
.PHONY: clean
-include source/Makefile
hjb-obj = $(addprefix ${BUILD}/, ${hjb-obj-y})
attack-obj = $(addprefix ${BUILD}/, ${attack-obj-y})
deps += $(hjb-obj:.o=.d)
deps += $(attack-obj:.o=.d)
-include ${deps}
libhjbcrypt.so: CFLAGS += -fPIC
libhjbcrypt.so: LDFLAGS += -shared
libhjbcrypt.so: $(hjb-obj)
@echo "LD $(notdir $@)"
@mkdir -p "$(dir $@)"
@${CC} ${hjb-obj} -o $@ ${LDFLAGS} ${CFLAGS} ${LIBS}
attack: libhjbcrypt.so ${attack-obj}
@echo "LD $(notdir $@)"
@mkdir -p "$(dir $@)"
@${CC} ${attack-obj} -o $@ ${LDFLAGS} ${CFLAGS} ${LIBS} -L. -lhjbcrypt
$(BUILD)/%.o: %.c
@echo "CC $<"
@mkdir -p "$(dir $@)"
@${CC} -c $< -o $@ ${CFLAGS} -MT $@ -MMD -MP -MF $(@:.o=.d)
clean:
@rm -f attack libhjbcrypt.so
@rm -rf ${BUILD}