mirror of
https://github.com/vale981/ray
synced 2025-03-06 10:31:39 -05:00
37 lines
1 KiB
Makefile
37 lines
1 KiB
Makefile
CC = gcc
|
|
CFLAGS = -g -Wall --std=c99 -D_XOPEN_SOURCE=500 -D_POSIX_C_SOURCE=200809L -fPIC -I. -Ithirdparty
|
|
BUILD = build
|
|
|
|
CFLAGS += -Wmissing-prototypes
|
|
CFLAGS += -Wstrict-prototypes
|
|
CFLAGS += -Wmissing-declarations
|
|
|
|
all: $(BUILD)/libcommon.a
|
|
|
|
$(BUILD)/libcommon.a: event_loop.o common.o task.o io.o state/redis.o
|
|
ar rcs $@ $^
|
|
|
|
$(BUILD)/db_tests: hiredis test/db_tests.c $(BUILD)/libcommon.a
|
|
$(CC) -o $@ test/db_tests.c $(BUILD)/libcommon.a thirdparty/hiredis/libhiredis.a $(CFLAGS)
|
|
|
|
$(BUILD)/io_tests: test/io_tests.c $(BUILD)/libcommon.a
|
|
$(CC) -o $@ $^ $(CFLAGS)
|
|
|
|
$(BUILD)/task_tests: test/task_tests.c $(BUILD)/libcommon.a
|
|
$(CC) -o $@ $^ $(CFLAGS)
|
|
|
|
clean:
|
|
rm -f *.o state/*.o test/*.o
|
|
rm -rf $(BUILD)/*
|
|
|
|
redis:
|
|
cd thirdparty ; bash ./build-redis.sh
|
|
|
|
hiredis:
|
|
git submodule update --init --recursive -- "thirdparty/hiredis" ; cd thirdparty/hiredis ; make
|
|
|
|
test: hiredis redis $(BUILD)/db_tests $(BUILD)/io_tests $(BUILD)/task_tests FORCE
|
|
./thirdparty/redis-3.2.3/src/redis-server &
|
|
sleep 1s ; ./build/db_tests ; ./build/io_tests ; ./build/task_tests
|
|
|
|
FORCE:
|