-
Notifications
You must be signed in to change notification settings - Fork 25
/
Makefile
46 lines (36 loc) · 930 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
BUILD_TYPE ?= debug
CFLAGS = -pipe -std=gnu11 -pthread -fno-strict-aliasing
CFLAGS += -Wall -Wextra -Wno-sign-compare -Wcast-align
LDFLAGS =
LIBS = -lpcap
ifeq ($(BUILD_TYPE),debug)
CFLAGS += -O1 -g
else
ifeq ($(BUILD_TYPE),release)
CFLAGS += -O3 -ggdb -DNDEBUG
else
$(error BUILD_TYPE must be one of release or debug)
endif
endif
PREFIX ?= /usr
BINDIR ?= $(PREFIX)/bin
SRC = \
main.c util.c \
scan.c scan-responder.c scan-reader.c \
target-parse.c target-gen.c \
rawsock-pcap.c rawsock-frame.c rawsock-routes.c \
output-list.c output-json.c output-binary.c \
tcp.c tcp-state.c udp.c icmp.c \
banner.c \
binary-write.c binary-read.c
OBJ = $(addprefix obj/, $(addsuffix .o, $(basename $(SRC))))
all: fi6s
fi6s: $(OBJ)
$(CC) $(CFLAGS) -o $@ $(OBJ) $(LDFLAGS) $(LIBS)
obj/%.o: src/%.c src/*.h
$(CC) $(CFLAGS) -c $< -o $@
clean:
rm -f $(OBJ)
install:
install -pDm755 fi6s $(DESTDIR)$(BINDIR)/fi6s
.PHONY: clean