-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile
43 lines (32 loc) · 964 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
PROJECT_NAME=jeep
BUILDOUT=bin
CC=gcc -w -std=c99 -Wall -Werror -Wextra
LIBS=-lncurses -lm
#EXPORTS=export LDFLAGS=-L/usr/lib/x86_64-linux-gnu/ # export LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu/
SOURCES = src/jeep.c
BUILDCMD_DIR = src/builtin
BUILDCMD_IN = $(BUILDCMD_DIR)/sniff.c
BUILDCMD_OUT = $(BUILDOUT)/sniff
INCLUDE_LIB = -I src/include/
all:
rm -rf bin/ && rm -rf obj/
mkdir -p bin/
mkdir -p obj/
# builtin cmds (bin/{sniff, ...})
$(CC) $(INCLUDE_LIB) -pthread $(BUILDCMD_IN) -o $(BUILDCMD_OUT) $(LIBS)
# kernel (bin/jeep)
$(CC) $(INCLUDE_LIB) -pthread $(SOURCES) -o $(BUILDOUT)/$(PROJECT_NAME) $(LIBS)
# obj
$(CC) $(INCLUDE_LIB) -pthread -c $(SOURCES)
mv *.o obj/
# fix perms
chmod +x bin/sniff
chmod +x bin/jeep
jeep:
rm -rf bin/ && rm -rf obj/
mkdir bin/ obj/
$(CC) -pthread $(SOURCES) -o $(BUILDOUT)/$(PROJECT_NAME) $(LIBS)
chmod +x bin/jeep && bin/jeep --version &
clean:
rm -f bin/$(PROJECT_NAME) *.o
rm -rf obj/*