replace Makefile by CMakeLists.txt

This commit is contained in:
Steffen Vogel 2017-12-14 01:00:56 +01:00
parent 9335d43e99
commit c4ea08d937
2 changed files with 23 additions and 27 deletions

23
CMakeLists.txt Normal file
View file

@ -0,0 +1,23 @@
cmake_minimum_required(VERSION 3.5)
project(netem C)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -std=c99")
add_executable(netem main.c
probe.c
emulate.c
timing.c
hist.c
utils.c
ts.c
tc.c
tcp.c
dist.c
dist-maketable.c
)
target_link_libraries(netem PUBLIC "-lrt -lnl-3 -lnl-route-3 -lm")
target_include_directories(netem PUBLIC "/usr/include/libnl3")
add_library(mark mark.c)

View file

@ -1,27 +0,0 @@
TARGETS = netem mark.so
OBJS = main.o probe.o emulate.o timing.o hist.o utils.o ts.o tc.o tcp.o dist.o dist-maketable.o
CC = gcc
CFLAGS = -g -lrt -std=c99 -Wall
CFLAGS += -I/usr/local/include/libnl3
CFLAGS += -I/usr/include/libnl3
LDLIBS = -lnl-3 -lnl-route-3 -lm
all: $(TARGETS) Makefile
netem: $(OBJS)
$(CC) $(LDLIBS) -o $@ $^
mark.so: mark.c
$(CC) -g -fPIC -c -o mark.o mark.c
$(CC) -shared -o mark.so mark.o -ldl
clean:
rm -f $(TARGETS)
rm -f *.o *~
.PHONY: all clean libnl