3 TOPDIR
= `basename ${PWD}`
4 GIT_VER
= $(shell git describe
--tags --dirty
--always
2>/dev
/null
)
5 uname_S
:= $(shell sh
-c
'uname -s 2>/dev/null || echo not')
6 deltacast_inc
:= $(shell sh
-c
'test -f /usr/include/StreamMaster.h && echo -n Y')
8 CFLAGS ?
= -O3
-fomit-frame-pointer
-g
9 CFLAGS
+= -Wall
-Wformat-security
-Wno-strict-aliasing
-Wextra
-Wno-unused-parameter
-Wimplicit-fallthrough
=3
10 CFLAGS
+= -DVERSION
=\"$(VERSION_MAJOR
).
$(VERSION_MINOR
)\"
11 CFLAGS
+= -DVERSION_MAJOR
=$(VERSION_MAJOR
)
12 CFLAGS
+= -DVERSION_MINOR
=$(VERSION_MINOR
)
14 CFLAGS
+= -DVERSION_EXTRA
=\"git-
$(GIT_VER
)\"
16 CFLAGS
+= -DVERSION_EXTRA
=\"release
\"
19 ifeq ($(uname_S
),Linux
)
22 ifeq ($(uname_S
),Darwin
)
27 LDLIBS_DVBLAST
+= -lpthread
-lev
29 OBJ_DVBLAST
= dvblast.o util.o dvb.o udp.o demux.o output.o comm.o
30 OBJ_DVBLASTCTL
= util.o dvblastctl.o
36 CLEAN_OBJS
= dvblast dvblastctl
$(OBJ_DVBLAST
) $(OBJ_DVBLASTCTL
)
37 INSTALL_BIN
= dvblast dvblastctl dvblast_mmi.sh
38 INSTALL_MAN
= dvblast
.1
41 BIN
= $(subst //,/,$(DESTDIR
)/$(PREFIX
)/bin
)
42 MAN
= $(subst //,/,$(DESTDIR
)/$(PREFIX
)/share
/man
/man1
)
44 all: dvblast dvblastctl
46 .PHONY
: clean install uninstall dist
48 %.o
: %.c Makefile config.h dvblast.h comm.h
50 $(Q
)$(CROSS
)$(CC
) $(CFLAGS
) $(CPPFLAGS
) -c
$<
52 dvblast
: $(OBJ_DVBLAST
)
54 $(Q
)$(CROSS
)$(CC
) $(LDFLAGS
) -o
$@
$(OBJ_DVBLAST
) $(LDLIBS_DVBLAST
) $(LDLIBS
)
56 dvblastctl
: $(OBJ_DVBLASTCTL
)
58 $(Q
)$(CROSS
)$(CC
) $(LDFLAGS
) -o
$@
$(OBJ_DVBLASTCTL
) $(LDLIBS
)
61 @echo
"CLEAN $(CLEAN_OBJS)"
62 $(Q
)rm -f
$(CLEAN_OBJS
)
69 @echo
"INSTALL $(INSTALL_MAN) -> $(MAN)"
70 $(Q
)install -m
644 dvblast
.1 "$(MAN)"
71 @echo
"INSTALL $(INSTALL_BIN) -> $(BIN)"
72 $(Q
)install dvblast dvblastctl
"$(BIN)"
75 @
-for FILE in
$(INSTALL_BIN
); do \
76 echo
"RM $(BIN)/$$FILE"; \
79 @
-for FILE in
$(INSTALL_MAN
); do \
80 echo
"RM $(MAN)/$$FILE"; \
85 @echo
"ARCHIVE dvblast-$(VERSION_MAJOR).$(VERSION_MINOR).tar.bz2"
86 $(Q
)git archive
--format
=tar --prefix=dvblast-
$(VERSION_MAJOR
).
$(VERSION_MINOR
)/ master | bzip2
-9 > dvblast-
$(VERSION_MAJOR
).
$(VERSION_MINOR
).
tar.bz2
87 $(Q
)ls
-l dvblast-
$(VERSION_MAJOR
).
$(VERSION_MINOR
).
tar.bz2