neatvnc/Makefile

52 lines
1.3 KiB
Makefile
Raw Normal View History

2019-08-29 22:07:04 +00:00
all: libneatvnc.so
2019-08-27 19:57:52 +00:00
DEPENDENCIES := pixman-1 libpng libuv
2019-08-31 15:50:23 +00:00
CFLAGS := -g -O3 -mavx -DNDEBUG -std=gnu11 -D_GNU_SOURCE -Iinc \
-fvisibility=hidden -Icontrib/miniz \
2019-08-27 19:57:52 +00:00
$(foreach dep,$(DEPENDENCIES),$(shell pkg-config --cflags $(dep)))
LDFLAGS := $(foreach dep,$(DEPENDENCIES),$(shell pkg-config --libs $(dep)))
2019-08-31 15:50:23 +00:00
libneatvnc.so.0.0: src/server.o src/util.o src/vec.o src/zrle.o src/pngfb.o \
src/miniz.o
2019-08-28 22:46:47 +00:00
$(CC) -fPIC -shared $^ $(LDFLAGS) -o $@
2019-08-27 19:57:52 +00:00
2019-08-29 22:07:04 +00:00
libneatvnc.so.0: libneatvnc.so.0.0
ln -sf $^ $@
2019-08-29 22:07:04 +00:00
libneatvnc.so: libneatvnc.so.0
ln -sf $^ $@
2019-08-29 22:07:04 +00:00
2019-08-27 22:29:46 +00:00
zrle-bench: bench/zrle-bench.o src/server.o src/util.o src/vec.o src/zrle.o \
2019-08-31 15:50:23 +00:00
src/pngfb.o src/miniz.o
2019-08-27 22:29:46 +00:00
$(CC) $^ $(LDFLAGS) -o $@
2019-08-29 22:07:04 +00:00
examples/png-server: examples/png-server.o src/pngfb.o libneatvnc.so
$(CC) $^ $(LDFLAGS) -L. -lneatvnc -Wl,-rpath=$(shell pwd) -o $@
examples/draw: examples/draw.o libneatvnc.so
$(CC) $^ $(LDFLAGS) -L. -lneatvnc -Wl,-rpath=$(shell pwd) -o $@
2019-08-27 19:57:52 +00:00
src/%.o: src/%.c
$(CC) -c $(CFLAGS) $< -o $@ -MMD -MP -MF $@.deps
2019-08-31 15:50:23 +00:00
src/miniz.o: contrib/miniz/miniz.c
$(CC) -c $(CFLAGS) $< -o $@ -MMD -MP -MF $@.deps
2019-08-27 22:29:46 +00:00
bench/%.o: bench/%.c
$(CC) -c $(CFLAGS) $< -o $@ -MMD -MP -MF $@.deps
2019-08-29 22:07:04 +00:00
examples/%.o: examples/%.c
$(CC) -c $(CFLAGS) $< -o $@ -MMD -MP -MF $@.deps
2019-08-27 19:57:52 +00:00
.PHONY: clean
clean:
2019-08-29 22:07:04 +00:00
rm -f libneatvnc.so*
2019-08-27 22:29:46 +00:00
rm -f src/*.o src/*.deps bench/*.o bench/*.deps
2019-08-27 19:57:52 +00:00
-include src/*.deps
.SUFFIXES:
.SECONDARY: