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
+= -Wall
-Wformat-security
-O3
-fomit-frame-pointer
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
)
26 ifeq ($(deltacast_inc
),Y
)
27 CFLAGS
+= -DHAVE_ASI_DELTACAST_SUPPORT
28 LDLIBS
+= -lstreammaster
31 LDLIBS_DVBLAST
+= -lpthread
-lev
33 OBJ_DVBLAST
= dvblast.o util.o dvb.o udp.o asi.o demux.o output.o en50221.o comm.o mrtg-cnt.o asi-deltacast.o
34 OBJ_DVBLASTCTL
= util.o dvblastctl.o
40 CLEAN_OBJS
= dvblast dvblastctl
$(OBJ_DVBLAST
) $(OBJ_DVBLASTCTL
)
41 INSTALL_BIN
= dvblast dvblastctl dvblast_mmi.sh
42 INSTALL_MAN
= dvblast
.1
45 BIN
= $(subst //,/,$(DESTDIR
)/$(PREFIX
)/bin
)
46 MAN
= $(subst //,/,$(DESTDIR
)/$(PREFIX
)/share
/man
/man1
)
48 all: dvblast dvblastctl
50 .PHONY
: clean install uninstall dist
52 %.o
: %.c Makefile config.h dvblast.h en50221.h comm.h asi.h mrtg-cnt.h asi-deltacast.h
54 $(Q
)$(CROSS
)$(CC
) $(CFLAGS
) $(CPPFLAGS
) -c
$<
56 dvblast
: $(OBJ_DVBLAST
)
58 $(Q
)$(CROSS
)$(CC
) -o
$@
$(OBJ_DVBLAST
) $(LDLIBS_DVBLAST
) $(LDLIBS
)
60 dvblastctl
: $(OBJ_DVBLASTCTL
)
62 $(Q
)$(CROSS
)$(CC
) -o
$@
$(OBJ_DVBLASTCTL
) $(LDLIBS
)
65 @echo
"CLEAN $(CLEAN_OBJS)"
66 $(Q
)rm -f
$(CLEAN_OBJS
)
73 @echo
"INSTALL $(INSTALL_MAN) -> $(MAN)"
74 $(Q
)install -m
644 dvblast
.1 "$(MAN)"
75 @echo
"INSTALL $(INSTALL_BIN) -> $(BIN)"
76 $(Q
)install dvblast dvblastctl dvblast_mmi.sh
"$(BIN)"
79 @
-for FILE in
$(INSTALL_BIN
); do \
80 echo
"RM $(BIN)/$$FILE"; \
83 @
-for FILE in
$(INSTALL_MAN
); do \
84 echo
"RM $(MAN)/$$FILE"; \
89 @echo
"ARCHIVE dvblast-$(VERSION).tar.bz2"
90 $(Q
)git archive
--format
=tar --prefix=dvblast-
$(VERSION
)/ master | bzip2
-9 > dvblast-
$(VERSION
).
tar.bz2
91 $(Q
)ls
-l dvblast-
$(VERSION
).
tar.bz2