-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
34 lines (25 loc) · 726 Bytes
/
Copy pathMakefile
File metadata and controls
34 lines (25 loc) · 726 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
#Builder for PacketGenerator project
CC = gcc
LD = gcc
CFLAGS = -g -O3 -Wall -Werror -D_REENTRANT
LDFLAGS = -lpthread -lrt -lm
OUTPUTFILE = PacketGenerator
# Source Directories
HEADERS_PATH = ./inc/
HEADERS_FILES = $(wildcard $(HEADERS_PATH)*.h)
SOURCES_PATH = ./src/
SOURCES_FILES = $(wildcard $(SOURCES_PATH)*.c)
OBJECTS = $(patsubst %.c,%.o,$(SOURCES_FILES))
%.o: %.c $(HEADERS_FILES)
$(CC) -c $(CFLAGS) -I $(HEADERS_PATH) -o $@ $<
all: $(OBJECTS)
@echo "Linking..."
$(LD) $(OBJECTS) $(LDFLAGS) -o $(OUTPUTFILE) -Wl,-Map=$(OUTPUTFILE).map
size $(OUTPUTFILE)
.PHONY: clean
clean:
@echo "Clean..."
rm -rf $(OBJECTS)
rm -rf $(OUTPUTFILE)
rm -rf $(OUTPUTFILE).map
rm -rf *.d