Remove excessive debug, extend search for start
[dvblastpn.git] / Makefile
blob5e49aaeb823d0e912a7941473c6e050df9f129dd
1 VERSION_MAJOR = 3
2 VERSION_MINOR = 4
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)
13 ifneq "$(GIT_VER)" ""
14 CFLAGS += -DVERSION_EXTRA=\"git-$(GIT_VER)\"
15 else
16 CFLAGS += -DVERSION_EXTRA=\"release\"
17 endif
19 ifeq ($(uname_S),Linux)
20 LDLIBS += -lrt
21 endif
22 ifeq ($(uname_S),Darwin)
23 LDLIBS += -liconv
24 endif
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
32 ifndef V
33 Q = @
34 endif
36 CLEAN_OBJS = dvblast dvblastctl $(OBJ_DVBLAST) $(OBJ_DVBLASTCTL)
37 INSTALL_BIN = dvblast dvblastctl dvblast_mmi.sh
38 INSTALL_MAN = dvblast.1
40 PREFIX ?= /usr/local
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
49 @echo "CC $<"
50 $(Q)$(CROSS)$(CC) $(CFLAGS) $(CPPFLAGS) -c $<
52 dvblast: $(OBJ_DVBLAST)
53 @echo "LINK $@"
54 $(Q)$(CROSS)$(CC) $(LDFLAGS) -o $@ $(OBJ_DVBLAST) $(LDLIBS_DVBLAST) $(LDLIBS)
56 dvblastctl: $(OBJ_DVBLASTCTL)
57 @echo "LINK $@"
58 $(Q)$(CROSS)$(CC) $(LDFLAGS) -o $@ $(OBJ_DVBLASTCTL) $(LDLIBS)
60 clean:
61 @echo "CLEAN $(CLEAN_OBJS)"
62 $(Q)rm -f $(CLEAN_OBJS)
64 distclean: clean
66 install: all
67 @install -d "$(BIN)"
68 @install -d "$(MAN)"
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)"
74 uninstall:
75 @-for FILE in $(INSTALL_BIN); do \
76 echo "RM $(BIN)/$$FILE"; \
77 rm "$(BIN)/$$FILE"; \
78 done
79 @-for FILE in $(INSTALL_MAN); do \
80 echo "RM $(MAN)/$$FILE"; \
81 rm "$(MAN)/$$FILE"; \
82 done
84 dist: clean
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