+ +
2da5fe7 OpenAVX v0.2.0 - High-performance open-standard IP audio and video transport suite
saifmukhtar · 2026-11-24
makefile · 304 lines · 15.7 KB
main
| 1 | CROSS_COMPILE ?= |
| 2 | CC ?= $(CROSS_COMPILE)gcc |
| 3 | CXX ?= $(CROSS_COMPILE)g++ |
| 4 | AR ?= $(CROSS_COMPILE)ar |
| 5 | STRIP ?= $(CROSS_COMPILE)strip |
| 6 | |
| 7 | UNAME_S := $(shell uname -s) |
| 8 | UNAME_M := $(shell uname -m) |
| 9 | |
| 10 | # BSD Unix detection (FreeBSD, OpenBSD, NetBSD, DragonFly) - dlopen in libc (no -ldl) |
| 11 | ifeq ($(findstring BSD,$(UNAME_S)),BSD) |
| 12 | LIBS ?= -lpthread -lm |
| 13 | else ifeq ($(UNAME_S),DragonFly) |
| 14 | LIBS ?= -lpthread -lm |
| 15 | else ifeq ($(UNAME_S),Darwin) |
| 16 | LIBS ?= -lpthread -lm |
| 17 | else |
| 18 | LIBS ?= -lpthread -lm -ldl |
| 19 | endif |
| 20 | |
| 21 | # ARM 32-bit (armv7l/armhf) NEON hardware float flags |
| 22 | ifeq ($(findstring arm,$(UNAME_M)),arm) |
| 23 | ifeq ($(findstring aarch64,$(UNAME_M)),) |
| 24 | ARM_NEON_FLAGS ?= -mfpu=neon -mfloat-abi=hard |
| 25 | endif |
| 26 | endif |
| 27 | |
| 28 | CFLAGS ?= -std=c99 -D_POSIX_C_SOURCE=200809L -O3 -flto -Wall -Wextra -fPIC -Iinclude -Ithird-party/monocypher $(ARM_NEON_FLAGS) |
| 29 | CXXFLAGS ?= -std=c++11 -O3 -Wall -Wextra -fPIC -Iinclude $(ARM_NEON_FLAGS) |
| 30 | LDFLAGS ?= -shared -flto -Wl,-soname,libopenavx.so.1 -Wl,--version-script=openavx.map |
| 31 | |
| 32 | PREFIX ?= /usr/local |
| 33 | EXEC_PREFIX ?= $(PREFIX) |
| 34 | LIBDIR ?= $(EXEC_PREFIX)/lib |
| 35 | INCDIR ?= $(PREFIX)/include |
| 36 | BINDIR ?= $(EXEC_PREFIX)/bin |
| 37 | PKGCONFIGDIR ?= $(LIBDIR)/pkgconfig |
| 38 | VERSION ?= 1.0.0 |
| 39 | |
| 40 | SRCS = src/avx_instance.c src/avx_find.c src/avx_send.c src/avx_recv.c src/avx_socket.c src/avx_video_codec.c src/avx_video_v4l2.c src/avx_video_avcodec.c src/avx_video_mf.c src/avx_video_vt.c src/avx_speedhq.c src/avx_udp.c src/avx_discovery_server.c src/avx_color.c src/avx_routing.c src/avx_simd.c src/avx_audio.c src/avx_rtsp.c src/avx_hdr.c src/avx_utilities.c src/avx_framesync.c src/avx_recv_ex.c src/avx_config.c src/avx_wire.c src/avx_log.c src/oavx_pipeline.c |
| 41 | OBJS = $(SRCS:.c=.o) |
| 42 | TARGET = build/libopenavx.so.1 |
| 43 | |
| 44 | all: directories $(TARGET) build/openavx.pc bin/openavx_test bin/openavx_stream_sender bin/openavx_loopback_test bin/openavx_speedhq_test bin/openavx_speedhq_alpha_test bin/openavx_compressed_loopback_test bin/openavx_discovery_udp_test bin/openavx-discovery-server bin/openavx_discovery_server_test bin/openavx_metadata_tally_test bin/openavx_alpha_color_test bin/openavx_routing_test bin/openavx-monitor bin/openavx_monitor_test bin/openavx-find bin/openavx_find_test bin/openavx-test-pattern bin/openavx_test_pattern_test bin/openavx-router bin/openavx_router_test bin/openavx_api_v3_test bin/openavx_config_test bin/openavx_platform_test bin/openavx_cpp_test bin/openavx_bench bin/openavx_audio_test bin/openavx_rtsp_test bin/openavx_v6_hdr_test bin/openavx_framesync_util_test bin/openavx_ptz_compat_test bin/openavx_mdns_discovery_test bin/oavx_stream_test bin/oavx_async_fd_test bin/oavx_telemetry_test bin/oavx_multiclient_test bin/openavx_multinic_test bin/openavx_rudp_test bin/openavx_ipv6_test bin/openavx_congestion_test bin/openavx_failover_test bin/oavx_stream_rudp_test |
| 45 | |
| 46 | directories: |
| 47 | @mkdir -p build bin |
| 48 | |
| 49 | $(TARGET): $(OBJS) openavx.map | directories |
| 50 | $(CC) $(LDFLAGS) -o $@ $(OBJS) $(LIBS) |
| 51 | @ln -sf libopenavx.so.1 build/libopenavx.so |
| 52 | |
| 53 | build/openavx.pc: openavx.pc.in | directories |
| 54 | @sed -e 's|@PREFIX@|$(PREFIX)|g' \ |
| 55 | -e 's|@LIBDIR@|$(LIBDIR)|g' \ |
| 56 | -e 's|@INCDIR@|$(INCDIR)|g' \ |
| 57 | -e 's|@VERSION@|$(VERSION)|g' \ |
| 58 | $< > $@ |
| 59 | |
| 60 | %.o: %.c |
| 61 | $(CC) $(CFLAGS) -c $< -o $@ |
| 62 | |
| 63 | bin/openavx_test: test/openavx_test.c $(TARGET) |
| 64 | $(CC) -std=c99 -D_POSIX_C_SOURCE=200809L -O3 -Iinclude $< -Lbuild -lopenavx -Wl,-rpath,'$$ORIGIN/../build' $(LIBS) -o $@ |
| 65 | |
| 66 | bin/openavx_stream_sender: test/openavx_stream_sender.c $(TARGET) |
| 67 | $(CC) -std=c99 -D_POSIX_C_SOURCE=200809L -O3 -Iinclude $< -Lbuild -lopenavx -Wl,-rpath,'$$ORIGIN/../build' $(LIBS) -o $@ |
| 68 | |
| 69 | bin/openavx_loopback_test: test/openavx_loopback_test.c $(TARGET) |
| 70 | $(CC) -std=c99 -D_POSIX_C_SOURCE=200809L -O3 -Iinclude $< -Lbuild -lopenavx -Wl,-rpath,'$$ORIGIN/../build' $(LIBS) -o $@ |
| 71 | |
| 72 | bin/openavx_speedhq_test: test/openavx_speedhq_test.c src/avx_speedhq.c $(TARGET) |
| 73 | $(CC) -std=c99 -D_POSIX_C_SOURCE=200809L -O3 -Iinclude $< src/avx_speedhq.c -Lbuild -lopenavx -Wl,-rpath,'$$ORIGIN/../build' $(LIBS) -o $@ |
| 74 | |
| 75 | bin/openavx_speedhq_alpha_test: test/openavx_speedhq_alpha_test.c $(TARGET) |
| 76 | $(CC) -std=c99 -D_POSIX_C_SOURCE=200809L -O3 -Iinclude $< -Lbuild -lopenavx -Wl,-rpath,'$$ORIGIN/../build' $(LIBS) -o $@ |
| 77 | |
| 78 | bin/openavx_compressed_loopback_test: test/openavx_compressed_loopback_test.c $(TARGET) |
| 79 | $(CC) -std=c99 -D_POSIX_C_SOURCE=200809L -O3 -Iinclude $< -Lbuild -lopenavx -Wl,-rpath,'$$ORIGIN/../build' $(LIBS) -o $@ |
| 80 | |
| 81 | bin/openavx_discovery_udp_test: test/openavx_discovery_udp_test.c src/avx_udp.c src/avx_socket.c src/avx_wire.c $(TARGET) |
| 82 | $(CC) -std=c99 -D_POSIX_C_SOURCE=200809L -O3 -Iinclude $< src/avx_udp.c src/avx_socket.c src/avx_wire.c -Lbuild -lopenavx -Wl,-rpath,'$$ORIGIN/../build' $(LIBS) -o $@ |
| 83 | |
| 84 | bin/openavx-discovery-server: src/avx_discovery_server_main.c src/avx_discovery_server.c src/avx_socket.c |
| 85 | $(CC) -std=c99 -D_POSIX_C_SOURCE=200809L -O3 -Iinclude $^ $(LIBS) -o $@ |
| 86 | @ln -sf openavx-discovery-server bin/openavx_discovery_server |
| 87 | |
| 88 | bin/openavx_discovery_server_test: test/openavx_discovery_server_test.c src/avx_discovery_server.c src/avx_socket.c $(TARGET) |
| 89 | $(CC) -std=c99 -D_POSIX_C_SOURCE=200809L -O3 -Iinclude $< src/avx_discovery_server.c src/avx_socket.c -Lbuild -lopenavx -Wl,-rpath,'$$ORIGIN/../build' $(LIBS) -o $@ |
| 90 | |
| 91 | bin/openavx_metadata_tally_test: test/openavx_metadata_tally_test.c $(TARGET) |
| 92 | $(CC) -std=c99 -D_POSIX_C_SOURCE=200809L -O3 -Iinclude $< -Lbuild -lopenavx -Wl,-rpath,'$$ORIGIN/../build' $(LIBS) -o $@ |
| 93 | |
| 94 | bin/openavx_alpha_color_test: test/openavx_alpha_color_test.c src/avx_color.c $(TARGET) |
| 95 | $(CC) -std=c99 -D_POSIX_C_SOURCE=200809L -O3 -Iinclude $< src/avx_color.c -Lbuild -lopenavx -Wl,-rpath,'$$ORIGIN/../build' $(LIBS) -o $@ |
| 96 | |
| 97 | bin/openavx_routing_test: test/openavx_routing_test.c $(TARGET) |
| 98 | $(CC) -std=c99 -D_POSIX_C_SOURCE=200809L -O3 -Iinclude $< -Lbuild -lopenavx -Wl,-rpath,'$$ORIGIN/../build' $(LIBS) -o $@ |
| 99 | |
| 100 | bin/openavx-monitor: tools/openavx_monitor.c tools/avx_audio_output.c $(TARGET) |
| 101 | $(CC) -std=c99 -D_POSIX_C_SOURCE=200809L -O3 -Iinclude -Itools $< tools/avx_audio_output.c -Lbuild -lopenavx -Wl,-rpath,'$$ORIGIN/../build' $(LIBS) -o $@ |
| 102 | @ln -sf openavx-monitor bin/openavx_monitor |
| 103 | |
| 104 | bin/openavx_monitor_test: test/openavx_monitor_test.c $(TARGET) |
| 105 | $(CC) -std=c99 -D_POSIX_C_SOURCE=200809L -O3 -Iinclude $< -Lbuild -lopenavx -Wl,-rpath,'$$ORIGIN/../build' $(LIBS) -o $@ |
| 106 | |
| 107 | bin/openavx-find: tools/openavx_find.c $(TARGET) |
| 108 | $(CC) -std=c99 -D_POSIX_C_SOURCE=200809L -O3 -Iinclude $< -Lbuild -lopenavx -Wl,-rpath,'$$ORIGIN/../build' $(LIBS) -o $@ |
| 109 | @ln -sf openavx-find bin/openavx_find |
| 110 | |
| 111 | bin/openavx_find_test: test/openavx_find_test.c $(TARGET) |
| 112 | $(CC) -std=c99 -D_POSIX_C_SOURCE=200809L -O3 -Iinclude $< -Lbuild -lopenavx -Wl,-rpath,'$$ORIGIN/../build' $(LIBS) -o $@ |
| 113 | |
| 114 | bin/openavx-test-pattern: tools/openavx_test_pattern.c $(TARGET) |
| 115 | $(CC) -std=c99 -D_POSIX_C_SOURCE=200809L -O3 -Iinclude -Itest/fixtures $< -Lbuild -lopenavx -Wl,-rpath,'$$ORIGIN/../build' $(LIBS) -lm -o $@ |
| 116 | @ln -sf openavx-test-pattern bin/openavx_test_pattern |
| 117 | |
| 118 | bin/openavx_test_pattern_test: test/openavx_test_pattern_test.c $(TARGET) |
| 119 | $(CC) -std=c99 -D_POSIX_C_SOURCE=200809L -O3 -Iinclude -Itest $< -Lbuild -lopenavx -Wl,-rpath,'$$ORIGIN/../build' $(LIBS) -lm -o $@ |
| 120 | |
| 121 | bin/openavx-router: tools/openavx_router.c $(TARGET) |
| 122 | $(CC) -std=c99 -D_POSIX_C_SOURCE=200809L -O3 -Iinclude $< -Lbuild -lopenavx -Wl,-rpath,'$$ORIGIN/../build' $(LIBS) -o $@ |
| 123 | @ln -sf openavx-router bin/openavx_router |
| 124 | |
| 125 | bin/openavx_router_test: test/openavx_router_test.c $(TARGET) |
| 126 | $(CC) -std=c99 -D_POSIX_C_SOURCE=200809L -O3 -Iinclude $< -Lbuild -lopenavx -Wl,-rpath,'$$ORIGIN/../build' $(LIBS) -o $@ |
| 127 | |
| 128 | bin/openavx_api_v3_test: test/openavx_api_v3_test.c $(TARGET) |
| 129 | $(CC) -std=c99 -D_POSIX_C_SOURCE=200809L -O3 -Iinclude $< -Lbuild -lopenavx -Wl,-rpath,'$$ORIGIN/../build' $(LIBS) -o $@ |
| 130 | |
| 131 | bin/openavx_config_test: test/openavx_config_test.c $(TARGET) |
| 132 | $(CC) -std=c99 -D_POSIX_C_SOURCE=200809L -O3 -Iinclude $< -Lbuild -lopenavx -Wl,-rpath,'$$ORIGIN/../build' $(LIBS) -o $@ |
| 133 | |
| 134 | bin/openavx_platform_test: test/openavx_platform_test.c $(TARGET) |
| 135 | $(CC) -std=c99 -D_POSIX_C_SOURCE=200809L -O3 -Iinclude $< -Lbuild -lopenavx -Wl,-rpath,'$$ORIGIN/../build' $(LIBS) -o $@ |
| 136 | |
| 137 | bin/openavx_cpp_test: test/openavx_cpp_test.cpp $(TARGET) |
| 138 | $(CXX) $(CXXFLAGS) $< -Lbuild -lopenavx -Wl,-rpath,'$$ORIGIN/../build' $(LIBS) -o $@ |
| 139 | |
| 140 | bin/openavx_bench: test/openavx_bench.c $(TARGET) |
| 141 | $(CC) $(CFLAGS) $< -Lbuild -lopenavx -Wl,-rpath,'$$ORIGIN/../build' $(LIBS) -o $@ |
| 142 | |
| 143 | bin/openavx_audio_test: test/openavx_audio_test.c $(TARGET) |
| 144 | $(CC) -std=c99 -D_POSIX_C_SOURCE=200809L -O3 -Iinclude $< -Lbuild -lopenavx -Wl,-rpath,'$$ORIGIN/../build' $(LIBS) -o $@ |
| 145 | |
| 146 | bin/openavx_rtsp_test: test/openavx_rtsp_test.c $(TARGET) |
| 147 | $(CC) -std=c99 -D_POSIX_C_SOURCE=200809L -O3 -Iinclude $< -Lbuild -lopenavx -Wl,-rpath,'$$ORIGIN/../build' $(LIBS) -o $@ |
| 148 | |
| 149 | bin/openavx_v6_hdr_test: test/openavx_v6_hdr_test.c $(TARGET) |
| 150 | $(CC) -std=c99 -D_POSIX_C_SOURCE=200809L -O3 -Iinclude $< -Lbuild -lopenavx -Wl,-rpath,'$$ORIGIN/../build' $(LIBS) -o $@ |
| 151 | |
| 152 | bin/openavx_framesync_util_test: test/openavx_framesync_util_test.c $(TARGET) |
| 153 | $(CC) -std=c99 -D_POSIX_C_SOURCE=200809L -O3 -Iinclude $< -Lbuild -lopenavx -Wl,-rpath,'$$ORIGIN/../build' $(LIBS) -o $@ |
| 154 | |
| 155 | bin/openavx_ptz_compat_test: test/openavx_ptz_compat_test.c $(TARGET) |
| 156 | $(CC) -std=c99 -D_POSIX_C_SOURCE=200809L -O3 -Iinclude $< -Lbuild -lopenavx -Wl,-rpath,'$$ORIGIN/../build' $(LIBS) -o $@ |
| 157 | |
| 158 | bin/openavx_mdns_discovery_test: test/openavx_mdns_discovery_test.c $(TARGET) |
| 159 | $(CC) -std=c99 -D_POSIX_C_SOURCE=200809L -O3 -Iinclude $< -Lbuild -lopenavx -Wl,-rpath,'$$ORIGIN/../build' $(LIBS) -o $@ |
| 160 | |
| 161 | bin/oavx_stream_test: test/oavx_stream_test.c $(TARGET) |
| 162 | $(CC) -std=c99 -D_POSIX_C_SOURCE=200809L -O3 -Iinclude $< -Lbuild -lopenavx -Wl,-rpath,'$$ORIGIN/../build' $(LIBS) -o $@ |
| 163 | |
| 164 | bin/oavx_async_fd_test: test/oavx_async_fd_test.c $(TARGET) |
| 165 | $(CC) -std=c99 -D_POSIX_C_SOURCE=200809L -O3 -Iinclude $< -Lbuild -lopenavx -Wl,-rpath,'$$ORIGIN/../build' $(LIBS) -o $@ |
| 166 | |
| 167 | bin/oavx_telemetry_test: test/oavx_telemetry_test.c $(TARGET) |
| 168 | $(CC) -std=c99 -D_POSIX_C_SOURCE=200809L -O3 -Iinclude $< -Lbuild -lopenavx -Wl,-rpath,'$$ORIGIN/../build' $(LIBS) -o $@ |
| 169 | |
| 170 | bin/oavx_multiclient_test: test/oavx_multiclient_test.c $(TARGET) |
| 171 | $(CC) -std=c99 -D_POSIX_C_SOURCE=200809L -O3 -Iinclude $< -Lbuild -lopenavx -Wl,-rpath,'$$ORIGIN/../build' $(LIBS) -o $@ |
| 172 | |
| 173 | bin/openavx_multinic_test: test/openavx_multinic_test.c src/avx_discovery_server.c src/avx_socket.c $(TARGET) |
| 174 | $(CC) -std=c99 -D_POSIX_C_SOURCE=200809L -O3 -Iinclude $< src/avx_discovery_server.c src/avx_socket.c -Lbuild -lopenavx -Wl,-rpath,'$$ORIGIN/../build' $(LIBS) -o $@ |
| 175 | |
| 176 | bin/openavx_rudp_test: test/openavx_rudp_test.c $(TARGET) |
| 177 | $(CC) -std=c99 -D_POSIX_C_SOURCE=200809L -O3 -Iinclude $< -Lbuild -lopenavx -Wl,-rpath,'$$ORIGIN/../build' $(LIBS) -o $@ |
| 178 | |
| 179 | bin/openavx_ipv6_test: test/openavx_ipv6_test.c src/avx_discovery_server.c src/avx_socket.c $(TARGET) |
| 180 | $(CC) -std=c99 -D_POSIX_C_SOURCE=200809L -O3 -Iinclude $< src/avx_discovery_server.c src/avx_socket.c -Lbuild -lopenavx -Wl,-rpath,'$$ORIGIN/../build' $(LIBS) -o $@ |
| 181 | |
| 182 | bin/openavx_congestion_test: test/openavx_congestion_test.c src/avx_speedhq.c $(TARGET) |
| 183 | $(CC) -std=c99 -D_POSIX_C_SOURCE=200809L -O3 -Iinclude $< src/avx_speedhq.c -Lbuild -lopenavx -Wl,-rpath,'$$ORIGIN/../build' $(LIBS) -o $@ |
| 184 | |
| 185 | bin/openavx_failover_test: test/openavx_failover_test.c $(TARGET) |
| 186 | $(CC) -std=c99 -D_POSIX_C_SOURCE=200809L -O3 -Iinclude $< -Lbuild -lopenavx -Wl,-rpath,'$$ORIGIN/../build' $(LIBS) -o $@ |
| 187 | |
| 188 | bin/oavx_stream_rudp_test: test/oavx_stream_rudp_test.c $(TARGET) |
| 189 | $(CC) -std=c99 -D_POSIX_C_SOURCE=200809L -O3 -Iinclude $< -Lbuild -lopenavx -Wl,-rpath,'$$ORIGIN/../build' $(LIBS) -o $@ |
| 190 | |
| 191 | clean: |
| 192 | rm -rf build bin $(OBJS) |
| 193 | |
| 194 | test: all |
| 195 | ./bin/openavx_test |
| 196 | ./bin/openavx_loopback_test |
| 197 | ./bin/openavx_speedhq_test |
| 198 | ./bin/openavx_speedhq_alpha_test |
| 199 | ./bin/openavx_compressed_loopback_test |
| 200 | ./bin/openavx_discovery_udp_test |
| 201 | ./bin/openavx_discovery_server_test |
| 202 | ./bin/openavx_metadata_tally_test |
| 203 | ./bin/openavx_alpha_color_test |
| 204 | ./bin/openavx_routing_test |
| 205 | ./bin/openavx_monitor_test |
| 206 | ./bin/openavx_find_test |
| 207 | ./bin/openavx_test_pattern_test |
| 208 | ./bin/openavx_router_test |
| 209 | ./bin/openavx_api_v3_test |
| 210 | ./bin/openavx_config_test |
| 211 | ./bin/openavx_platform_test |
| 212 | ./bin/openavx_cpp_test |
| 213 | ./bin/openavx_bench |
| 214 | ./bin/openavx_audio_test |
| 215 | ./bin/openavx_rtsp_test |
| 216 | ./bin/openavx_v6_hdr_test |
| 217 | ./bin/openavx_framesync_util_test |
| 218 | ./bin/openavx_ptz_compat_test |
| 219 | ./bin/openavx_mdns_discovery_test |
| 220 | ./bin/oavx_stream_test |
| 221 | ./bin/oavx_async_fd_test |
| 222 | ./bin/oavx_telemetry_test |
| 223 | ./bin/oavx_multiclient_test |
| 224 | ./bin/openavx_multinic_test |
| 225 | ./bin/openavx_rudp_test |
| 226 | ./bin/openavx_ipv6_test |
| 227 | ./bin/openavx_congestion_test |
| 228 | ./bin/openavx_failover_test |
| 229 | ./bin/oavx_stream_rudp_test |
| 230 | |
| 231 | install: all |
| 232 | @echo "[*] Installing OpenAVX (openavx) to $(DESTDIR)$(PREFIX)..." |
| 233 | @install -d $(DESTDIR)$(LIBDIR) |
| 234 | @install -d $(DESTDIR)$(INCDIR) |
| 235 | @install -d $(DESTDIR)$(BINDIR) |
| 236 | @install -d $(DESTDIR)$(PKGCONFIGDIR) |
| 237 | @install -m 755 $(TARGET) $(DESTDIR)$(LIBDIR)/libopenavx.so.1 |
| 238 | @ln -sf libopenavx.so.1 $(DESTDIR)$(LIBDIR)/libopenavx.so |
| 239 | @install -m 644 include/openavx.h $(DESTDIR)$(INCDIR)/ |
| 240 | @install -m 644 include/openavx.hpp $(DESTDIR)$(INCDIR)/ |
| 241 | @install -m 644 include/avx_color.h $(DESTDIR)$(INCDIR)/ |
| 242 | @install -m 644 include/avx_routing.h $(DESTDIR)$(INCDIR)/ |
| 243 | @install -m 644 include/avx_simd.h $(DESTDIR)$(INCDIR)/ |
| 244 | @install -m 644 include/avx_audio.h $(DESTDIR)$(INCDIR)/ |
| 245 | @install -m 644 include/avx_rtsp.h $(DESTDIR)$(INCDIR)/ |
| 246 | @install -m 644 include/avx_hdr.h $(DESTDIR)$(INCDIR)/ |
| 247 | @install -m 644 include/avx_config.h $(DESTDIR)$(INCDIR)/ |
| 248 | @install -m 644 include/avx_platform.h $(DESTDIR)$(INCDIR)/ |
| 249 | @install -m 755 bin/openavx-discovery-server $(DESTDIR)$(BINDIR)/ |
| 250 | @ln -sf openavx-discovery-server $(DESTDIR)$(BINDIR)/openavx_discovery_server |
| 251 | @install -m 755 bin/openavx-monitor $(DESTDIR)$(BINDIR)/ |
| 252 | @ln -sf openavx-monitor $(DESTDIR)$(BINDIR)/openavx_monitor |
| 253 | @install -m 755 bin/openavx-find $(DESTDIR)$(BINDIR)/ |
| 254 | @ln -sf openavx-find $(DESTDIR)$(BINDIR)/openavx_find |
| 255 | @install -m 755 bin/openavx-test-pattern $(DESTDIR)$(BINDIR)/ |
| 256 | @ln -sf openavx-test-pattern $(DESTDIR)$(BINDIR)/openavx_test_pattern |
| 257 | @install -m 755 bin/openavx-router $(DESTDIR)$(BINDIR)/ |
| 258 | @ln -sf openavx-router $(DESTDIR)$(BINDIR)/openavx_router |
| 259 | @sed -e 's|@PREFIX@|$(PREFIX)|g' \ |
| 260 | -e 's|@LIBDIR@|$(LIBDIR)|g' \ |
| 261 | -e 's|@INCDIR@|$(INCDIR)|g' \ |
| 262 | -e 's|@VERSION@|$(VERSION)|g' \ |
| 263 | openavx.pc.in > $(DESTDIR)$(PKGCONFIGDIR)/openavx.pc |
| 264 | @chmod 644 $(DESTDIR)$(PKGCONFIGDIR)/openavx.pc |
| 265 | @echo "[+] Successfully installed OpenAVX (openavx)." |
| 266 | |
| 267 | package: |
| 268 | @echo "[*] Generating native distribution packages (.deb, .rpm, .tar.gz)..." |
| 269 | @mkdir -p build-cpack dist |
| 270 | @cmake -B build-cpack -S . -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr -DBUILD_TESTING=OFF |
| 271 | @cmake --build build-cpack -j$$(nproc) |
| 272 | @cpack --config build-cpack/CPackConfig.cmake -B dist |
| 273 | @rm -rf build-cpack |
| 274 | @echo "[+] Distribution packages generated in dist/:" |
| 275 | @ls -lh dist/ |
| 276 | |
| 277 | uninstall: |
| 278 | @echo "[*] Uninstalling OpenAVX (openavx) from $(DESTDIR)$(PREFIX)..." |
| 279 | @rm -f $(DESTDIR)$(LIBDIR)/libopenavx.so.1 |
| 280 | @rm -f $(DESTDIR)$(LIBDIR)/libopenavx.so |
| 281 | @rm -f $(DESTDIR)$(INCDIR)/openavx.h |
| 282 | @rm -f $(DESTDIR)$(INCDIR)/openavx.hpp |
| 283 | @rm -f $(DESTDIR)$(INCDIR)/avx_color.h |
| 284 | @rm -f $(DESTDIR)$(INCDIR)/avx_routing.h |
| 285 | @rm -f $(DESTDIR)$(INCDIR)/avx_simd.h |
| 286 | @rm -f $(DESTDIR)$(INCDIR)/avx_audio.h |
| 287 | @rm -f $(DESTDIR)$(INCDIR)/avx_rtsp.h |
| 288 | @rm -f $(DESTDIR)$(INCDIR)/avx_hdr.h |
| 289 | @rm -f $(DESTDIR)$(INCDIR)/avx_config.h |
| 290 | @rm -f $(DESTDIR)$(INCDIR)/avx_platform.h |
| 291 | @rm -f $(DESTDIR)$(BINDIR)/openavx-discovery-server |
| 292 | @rm -f $(DESTDIR)$(BINDIR)/openavx_discovery_server |
| 293 | @rm -f $(DESTDIR)$(BINDIR)/openavx-monitor |
| 294 | @rm -f $(DESTDIR)$(BINDIR)/openavx_monitor |
| 295 | @rm -f $(DESTDIR)$(BINDIR)/openavx-find |
| 296 | @rm -f $(DESTDIR)$(BINDIR)/openavx_find |
| 297 | @rm -f $(DESTDIR)$(BINDIR)/openavx-test-pattern |
| 298 | @rm -f $(DESTDIR)$(BINDIR)/openavx_test_pattern |
| 299 | @rm -f $(DESTDIR)$(BINDIR)/openavx-router |
| 300 | @rm -f $(DESTDIR)$(BINDIR)/openavx_router |
| 301 | @rm -f $(DESTDIR)$(PKGCONFIGDIR)/openavx.pc |
| 302 | @echo "[+] Successfully uninstalled OpenAVX (openavx)." |
| 303 | |
| 304 | .PHONY: all clean test directories install uninstall package |