8 GIT-VERSION-FILE
: .FORCE-GIT-VERSION-FILE
10 -include GIT-VERSION-FILE
12 DISTNAME
= mmq-
$(GIT_VERSION
)
17 # overridable from command-line or config.mk
27 OBJS
:= $(addsuffix .o
,mmq-player
print ao input
)
28 HDRS
= $(wildcard compat
/*.h
*.h
)
30 ao.o
: cflags = $(CFLAGS
) $(MMQ_AO_CFLAGS
)
31 ao.o
: ao.c
$(MMQ_AO
).c mmq.h config.mk
32 $(CC
) -o
$*.o
-c
$(cflags) -DMMQ_AO_IMPL
='"$(MMQ_AO).c"' $<
34 FIXEDDEC_LIB
:= fixeddec
/libfixeddec.a
35 FIXEDDEC_OBJS
:= $(addprefix fixeddec
/,$(addsuffix .o
,flac tremor mad
))
36 $(FIXEDDEC_OBJS
): fixeddec
/fixeddec.h
37 $(FIXEDDEC_LIB
): $(FIXEDDEC_OBJS
)
39 $(AR
) rcs
$@
$(FIXEDDEC_OBJS
)
42 $(CC
) -o
$*.o
-c
$(CFLAGS
) $<
44 MMQ_DEC_LIBS
:= $(FIXEDDEC_LIB
)
46 MMQ_BIN
:= mmq-player mmq-enq
48 mmq-enq
: mmq-enq.c
print.o
49 $(CC
) $(CFLAGS
) -o
$@
$^
$(LDFLAGS
) $(LIBS
)
51 mmq-player
: ldflags = $(LDFLAGS
) $(MMQ_AO_LDFLAGS
)
52 mmq-player
: libs
= $(LIBS
) $(MMQ_AO_LIBS
) $(MMQ_DEC_LIBS
)
53 mmq-player
: $(OBJS
) $(MMQ_DEC_LIBS
)
54 $(CC
) $(CFLAGS
) -o
$@
$(OBJS
) $(ldflags) $(libs
) $(EXTLIBS
)
59 $(INSTALL
) -d
-m
755 '$(DESTDIR)$(bindir)'
60 $(INSTALL
) $^
'$(DESTDIR)$(bindir)'
63 $(STRIP
) $(STRIP_OPTS
) $(MMQ_BIN
)
68 dist: GIT-VERSION-FILE
69 git archive
--format
=tar --prefix=$(DISTNAME
)/ HEAD^
{tree
} \
70 | gzip
-9 > $(DISTNAME
).
tar.gz
+
71 mv
$(DISTNAME
).
tar.gz
+ $(DISTNAME
).
tar.gz
73 $(RM
) $(MMQ_BIN
) $(DISTNAME
).
tar.gz
* GIT-VERSION-FILE
$(OBJS
)
74 $(RM
) $(FIXEDDEC_OBJS
) $(FIXEDDEC_LIB
)
76 .PHONY
: .FORCE-GIT-VERSION-FILE
install