-
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Makefile
37 lines (27 loc) · 965 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
TARGET = ssh-honeypotd
C_SRC = main.c globals.c cmdline.c pidfile.c daemon.c worker.c log.c
C_DEPS = $(patsubst %.c,%.dep,$(C_SRC))
OBJS = $(patsubst %.c,%.o,$(C_SRC))
PKGCONFIG = pkg-config
LIBFLAGS = $(shell $(PKGCONFIG) --libs libssh) $(shell pkg-config --libs --silence-errors libssh_threads) -pthread
all: $(TARGET)
ifneq ($(strip $(C_DEPS)),)
-include $(C_DEPS)
endif
ssh-honeypotd: $(OBJS)
$(CC) $^ $(LIBFLAGS) $(LDFLAGS) -o $@
%.o: %.c
$(CC) $(CPPFLAGS) -fvisibility=hidden -Wall -Werror -Wno-error=attributes -Wno-unknown-pragmas $(CFLAGS) -c "$<" -MMD -MP -MF"$(@:%.o=%.dep)" -MT"$(@:%.o=%.dep)" -o "$@"
clean: objclean depclean
-rm -f $(TARGET)
objclean:
-rm -f $(OBJS)
depclean:
-rm -f $(C_DEPS)
keys:
mkdir -p keys
ssh-keygen -f keys/ssh_host_rsa_key -N '' -t rsa
ssh-keygen -f keys/ssh_host_ecdsa_key -N '' -t ecdsa
ssh-keygen -f keys/ssh_host_ed25519_key -N '' -t ed25519
docker-build: $(TARGET) keys
.PHONY: clean