forked from Silicondust/libhdhomerun
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
63 lines (52 loc) · 1.48 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
LIBSRCS += hdhomerun_channels.c
LIBSRCS += hdhomerun_channelscan.c
LIBSRCS += hdhomerun_control.c
LIBSRCS += hdhomerun_debug.c
LIBSRCS += hdhomerun_device.c
LIBSRCS += hdhomerun_device_selector.c
LIBSRCS += hdhomerun_discover.c
LIBSRCS += hdhomerun_os_posix.c
LIBSRCS += hdhomerun_pkt.c
LIBSRCS += hdhomerun_sock_posix.c
LIBSRCS += hdhomerun_video.c
CC := $(CROSS_COMPILE)gcc
STRIP := $(CROSS_COMPILE)strip
CFLAGS += -O2 -Wall -Wextra -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wpointer-arith -Wno-unused-parameter
LDFLAGS += -lpthread
SHARED = -shared -Wl,-soname,libhdhomerun$(LIBEXT)
ifeq ($(OS),Windows_NT)
BINEXT := .exe
LIBEXT := .dll
LDFLAGS += -liphlpapi
else
OS := $(shell uname -s)
LIBEXT := .so
ifeq ($(OS),Linux)
LDFLAGS += -lrt
endif
ifeq ($(OS),SunOS)
LDFLAGS += -lsocket
endif
ifeq ($(OS),Darwin)
ifeq ($(shell uname -m),x86_64)
CFLAGS += -arch x86_64
else
CFLAGS += -arch i386
endif
LIBEXT := .dylib
SHARED := -dynamiclib -install_name libhdhomerun$(LIBEXT)
endif
endif
all : hdhomerun_config$(BINEXT) libhdhomerun$(LIBEXT)
hdhomerun_config$(BINEXT) : hdhomerun_config.c $(LIBSRCS)
$(CC) $(CFLAGS) $+ $(LDFLAGS) -o $@
$(STRIP) $@
libhdhomerun$(LIBEXT) : $(LIBSRCS)
$(CC) $(CFLAGS) -fPIC -DDLL_EXPORT $(SHARED) $+ $(LDFLAGS) -o $@
clean :
-rm -f hdhomerun_config$(BINEXT)
-rm -f libhdhomerun$(LIBEXT)
distclean : clean
%:
@echo "(ignoring request to make $@)"
.PHONY: all list clean distclean