diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-03-09 13:19:48 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-03-09 13:20:02 +0000 |
commit | 58daab21cd043e1dc37024a7f99b396788372918 (patch) | |
tree | 96771e43bb69f7c1c2b0b4f7374cb74d7866d0cb /web/server/h2o/libh2o/deps/libyrmcds/Makefile | |
parent | Releasing debian version 1.43.2-1. (diff) | |
download | netdata-58daab21cd043e1dc37024a7f99b396788372918.tar.xz netdata-58daab21cd043e1dc37024a7f99b396788372918.zip |
Merging upstream version 1.44.3.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'web/server/h2o/libh2o/deps/libyrmcds/Makefile')
-rw-r--r-- | web/server/h2o/libh2o/deps/libyrmcds/Makefile | 87 |
1 files changed, 87 insertions, 0 deletions
diff --git a/web/server/h2o/libh2o/deps/libyrmcds/Makefile b/web/server/h2o/libh2o/deps/libyrmcds/Makefile new file mode 100644 index 000000000..d8614c047 --- /dev/null +++ b/web/server/h2o/libh2o/deps/libyrmcds/Makefile @@ -0,0 +1,87 @@ +# Makefile for libyrmcds + +PREFIX = /usr/local + +CC = gcc +CXX = g++ -std=gnu++11 +CPPFLAGS = -D_GNU_SOURCE + +# Uncomment the next line to remove the internal lock used to +# serialize sending commands. +# +#CPPFLAGS += -DLIBYRMCDS_NO_INTERNAL_LOCK + +OPTFLAGS = -gdwarf-3 -O2 +CFLAGS = -Wall -Wconversion $(OPTFLAGS) +CXXFLAGS = $(CFLAGS) -Wnon-virtual-dtor -Woverloaded-virtual +LDFLAGS = -L. +LDLIBS = -lyrmcds -lpthread + +EXE = yc yc-cnt +LIB = libyrmcds.a +PACKAGES = build-essential subversion doxygen + +CHEADERS = $(wildcard *.h) +CSOURCES = $(wildcard *.c) +COBJECTS = $(patsubst %.c,%.o,$(CSOURCES)) +LIB_OBJECTS = $(filter-out yc.o yc-cnt.o,$(COBJECTS)) +TEST_SOURCES = $(wildcard t/*.c) +TESTS = $(patsubst %.c,%,$(TEST_SOURCES)) + +all: lib $(EXE) +lib: $(LIB) + +# LZ4 is optional. Run "make lz4; make" to build LZ4 enabled library. +LZ4_TAG = r127 +WGET = wget -q -P lz4/lib +lz4: + mkdir -p lz4/lib + $(WGET) https://raw.githubusercontent.com/Cyan4973/lz4/$(LZ4_TAG)/lib/lz4.c + $(WGET) https://raw.githubusercontent.com/Cyan4973/lz4/$(LZ4_TAG)/lib/lz4.h + +ifeq ($(wildcard lz4), lz4) +$(info LZ4 transparent compression is *enabled*) +CPPFLAGS += -DLIBYRMCDS_USE_LZ4 +LZ4_CFLAGS = -std=c99 -O3 +lz4/lib/lz4.o: lz4/lib/lz4.c + $(CC) $(LZ4_CFLAGS) -Ilz4/lib -c -o $@ $< +LIB_OBJECTS += lz4/lib/lz4.o +endif + +yc: yc.o + $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< $(LDLIBS) + +yc-cnt: yc-cnt.o + $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< $(LDLIBS) + +$(COBJECTS): $(CHEADERS) +$(EXE): $(LIB) + +$(LIB): $(LIB_OBJECTS) + $(AR) rcs $@ $^ + +t/%.exe: t/%.c $(LIB) + $(CC) -I$(shell pwd) $(CFLAGS) $(LDFLAGS) -o $@ $< $(LDLIBS) + +$(TESTS): $(LIB) + @$(MAKE) -s $@.exe + @echo Running ./$@.exe + @./$@.exe + @echo + +test: $(TESTS) + +html: + rm -rf html + doxygen + +serve: html + @cd html; python -m SimpleHTTPServer 8888 || true + +clean: + rm -rf *.o t/*.exe html $(EXE) $(LIB) + +setup: + sudo apt-get install -y $(PACKAGES) + +.PHONY: all lib test html serve clean setup |