Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add clang support along with gcc #4

Merged
merged 2 commits into from
Feb 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ sysconfdir = ${prefix}/etc
init_script = etc/init.d/gtp-guard.init
conf_file = etc/gtp-guard/gtp-guard.conf

CC = gcc
CC ?= gcc
LDFLAGS = -lpthread -lcrypt -ggdb -lm -lz -lresolv -lelf
SUBDIRS = lib src
LIBBPF = libbpf
Expand Down
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,8 @@ git clone --recursive git@github.com:acassen/gtp-guard.git
cd gtp-guard
make -j $(nproc)
```

gcc is the default compiled. Should you prefer the usage of clang, then use:
```
CC=clang make -j $(nproc)
```
2 changes: 1 addition & 1 deletion lib/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
# Copyright (C) 2023 Alexandre Cassen, <acassen@gmail.com>
#

CC = gcc
CC ?= gcc
INCLUDES = -I.
CFLAGS = -g -O2 $(INCLUDES) -Wall -Wunused -Wstrict-prototypes
#DEFS = -D_DEBUG_
Expand Down
2 changes: 1 addition & 1 deletion src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
# Copyright (C) 2023 Alexandre Cassen, <acassen@gmail.com>
#

CC = gcc
CC ?= gcc
INCLUDES = -Iinclude -I../lib -I../libbpf/src -I../libbpf/src/uapi
CFLAGS = -g -O2 -ggdb $(INCLUDES) -Wall -Wunused -Wstrict-prototypes -D_GNU_SOURCE
#DEFS = -D_DEBUG_
Expand Down