odyssey/tests/makefile

65 lines
2.1 KiB
Makefile
Raw Normal View History

2016-11-24 13:13:49 +00:00
CC = gcc
RM = rm
2016-11-25 12:50:06 +00:00
CFLAGS = -I. -Wall -g -O0 -I../lib
LFLAGS_LIB = ../lib/libmachinarium.a
2016-12-06 12:58:39 +00:00
LFLAGS_LIB_UV = -luv -pthread #~/temp/libuv/.libs/libuv.a -pthread
2016-11-24 13:50:43 +00:00
LFLAGS = $(LFLAGS_LIB) $(LFLAGS_LIB_UV)
2016-11-25 09:56:41 +00:00
TESTS = test_new \
test_create \
test_sleep \
test_wait \
2016-11-25 10:31:06 +00:00
test_io_new \
2016-12-07 14:59:01 +00:00
test_getaddrinfo \
2016-11-25 10:52:02 +00:00
test_client_server \
2016-11-30 13:13:49 +00:00
test_client_server_ra \
2016-11-25 09:56:41 +00:00
test_cancel_sleep \
test_cancel_sleep_2 \
test_cancel_getaddrinfo \
2016-11-25 10:31:06 +00:00
test_cancel_connect \
2016-11-25 11:41:42 +00:00
test_cancel_connect_2 \
test_cancel_read \
benchmark \
echo
2016-11-24 13:25:40 +00:00
all: validate clean $(TESTS)
2016-11-25 09:56:41 +00:00
test_new:
$(CC) $(CFLAGS) test_new.c $(LFLAGS) -o test_new
test_create:
$(CC) $(CFLAGS) test_create.c $(LFLAGS) -o test_create
test_sleep:
$(CC) $(CFLAGS) test_sleep.c $(LFLAGS) -o test_sleep
test_wait:
$(CC) $(CFLAGS) test_wait.c $(LFLAGS) -o test_wait
2016-11-25 10:31:06 +00:00
test_io_new:
$(CC) $(CFLAGS) test_io_new.c $(LFLAGS) -o test_io_new
2016-12-07 14:59:01 +00:00
test_getaddrinfo:
$(CC) $(CFLAGS) test_getaddrinfo.c $(LFLAGS) -o test_getaddrinfo
2016-11-25 10:52:02 +00:00
test_client_server:
$(CC) $(CFLAGS) test_client_server.c $(LFLAGS) -o test_client_server
2016-11-30 13:13:49 +00:00
test_client_server_ra:
$(CC) $(CFLAGS) test_client_server_ra.c $(LFLAGS) -o test_client_server_ra
2016-11-25 09:56:41 +00:00
test_cancel_sleep:
$(CC) $(CFLAGS) test_cancel_sleep.c $(LFLAGS) -o test_cancel_sleep
test_cancel_sleep_2:
$(CC) $(CFLAGS) test_cancel_sleep_2.c $(LFLAGS) -o test_cancel_sleep_2
test_cancel_getaddrinfo:
$(CC) $(CFLAGS) test_cancel_getaddrinfo.c $(LFLAGS) -o test_cancel_getaddrinfo
2016-11-25 10:31:06 +00:00
test_cancel_connect:
$(CC) $(CFLAGS) test_cancel_connect.c $(LFLAGS) -o test_cancel_connect
test_cancel_connect_2:
$(CC) $(CFLAGS) test_cancel_connect_2.c $(LFLAGS) -o test_cancel_connect_2
2016-11-25 11:41:42 +00:00
test_cancel_read:
$(CC) $(CFLAGS) test_cancel_read.c $(LFLAGS) -o test_cancel_read
echo:
$(CC) $(CFLAGS) echo.c $(LFLAGS) -o echo
benchmark:
$(CC) $(CFLAGS) benchmark.c $(LFLAGS) -o benchmark
2016-11-24 13:13:49 +00:00
validate:
@if [ ! -f $(LFLAGS_LIB) ]; then \
echo ""; \
echo "Please build the library first."; \
echo ""; \
exit 1; \
fi
clean:
2016-11-24 13:25:40 +00:00
$(RM) -f $(TESTS)