-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
40 lines (28 loc) · 736 Bytes
/
Copy pathMakefile
File metadata and controls
40 lines (28 loc) · 736 Bytes
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
# Define the compiler
CC = gcc
# Define compiler flags
CFLAGS = -Wall -g
# Define linker flags (add -lcurl, -lssl, and -lcrypto for libcurl and OpenSSL)
LDFLAGS = -lcurl -lssl -lcrypto
# Define the target executable
TARGET = dns_forwarder
# Define source files
SRCS = dns_forwarder.c
# Define object files
OBJS = $(SRCS:.c=.o)
# Default target: build the executable
all: $(TARGET)
# Rule to build the executable
$(TARGET): $(OBJS)
$(CC) $(CFLAGS) -o $(TARGET) $(OBJS) $(LDFLAGS)
# Rule to build object files
%.o: %.c
$(CC) $(CFLAGS) -c $< -o $@
# Clean up the build files
clean:
rm -f $(OBJS) $(TARGET)
# Phony targets to avoid conflicts with filenames
.PHONY: all clean
# cleans log files
clean-logs:
rm -f queries.log