X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=Makefile.real;h=5df27bad934a58f04b4b6407e868e8898ded4002;hp=1fe29d460bdb5056523f2b4b47ec09b203c6d682;hb=e7f035b3ad7ecc64ec87d9ce890f89365dec1411;hpb=7031f4e380b429e9c0eea1b8e5484dabdbb12ae5 diff --git a/Makefile.real b/Makefile.real index 1fe29d46..5df27bad 100644 --- a/Makefile.real +++ b/Makefile.real @@ -10,7 +10,6 @@ endif LOGLEVELS := LL_DEBUG,LL_INFO,LL_NOTICE,LL_WARNING,LL_ERROR,LL_CRIT,LL_EMERG vardir := /var/paraslash mandir := $(datarootdir)/man/man1 -STRIP := $(CROSS_COMPILE)strip MKDIR_P := mkdir -p prefixed_executables := $(addprefix para_, $(executables)) @@ -19,7 +18,7 @@ uname_s := $(shell uname -s 2>/dev/null || echo "UNKNOWN_OS") uname_rs := $(shell uname -rs) cc_version := $(shell $(CC) --version | head -n 1) GIT_VERSION := $(shell ./GIT-VERSION-GEN git-version.h) -COPYRIGHT_YEAR := 2017 +COPYRIGHT_YEAR := 2019 ifeq ("$(origin O)", "command line") build_dir := $(O) @@ -33,12 +32,15 @@ m4depdir := $(build_dir)/m4deps lls_suite_dir := $(build_dir)/lls lls_m4_dir := m4/lls test_dir := t +yy_src_dir = yy +yy_build_dir = $(build_dir)/yy # sort removes duplicate words, which is all we need here all_objs := $(sort $(recv_objs) $(filter_objs) $(client_objs) $(gui_objs) \ $(audiod_objs) $(audioc_objs) $(mixer_objs) $(server_objs) \ $(write_objs) $(afh_objs) $(play_objs)) deps := $(addprefix $(dep_dir)/, $(all_objs:.o=.d)) +deps += $(addprefix $(dep_dir)/, mp.bison.d mp.flex.d) afh_objs += afh.lsg.o audioc_objs += audioc.lsg.o @@ -58,6 +60,12 @@ suites := $(addprefix $(lls_suite_dir)/, $(cmd_suites) $(executables)) m4_lls_deps := $(addsuffix .m4d, $(suites)) lsg_h := $(addsuffix .lsg.h, $(suites)) +# flex/bison objects and headers are only needed if para_server is built +ifeq ("$(findstring server, $(executables))", "server") + server_objs += mp.flex.o mp.bison.o + yy_h := $(yy_build_dir)/mp.bison.h +endif + # now prefix all objects with object dir recv_objs := $(addprefix $(object_dir)/, $(recv_objs)) filter_objs := $(addprefix $(object_dir)/, $(filter_objs)) @@ -76,21 +84,24 @@ man_pages := $(patsubst %, $(man_dir)/%.1, $(prefixed_executables)) autocrap := config.h.in configure tarball_pfx := $(PACKAGE_TARNAME)-$(GIT_VERSION) tarball_delete := $(addprefix $(tarball_pfx)/, web .gitignore) -tarball := $(tarball_pfx).tar.bz2 +tarball := $(tarball_pfx).tar.xz -.PHONY: all clean clean2 distclean maintainer-clean install man tarball all: $(prefixed_executables) $(man_pages) +.PHONY: all mostlyclean clean distclean maintainer-clean install \ + install-strip man dist tarball + man: $(man_pages) -tarball: $(tarball) include $(lls_m4_dir)/makefile include $(test_dir)/makefile.test +include $(yy_src_dir)/makefile ifeq ($(findstring clean, $(MAKECMDGOALS)),) -include $(deps) -include $(m4_lls_deps) endif -$(object_dir) $(man_dir) $(dep_dir) $(m4depdir) $(lls_suite_dir): +$(object_dir) $(man_dir) $(dep_dir) $(m4depdir) $(lls_suite_dir) \ + $(yy_build_dir): $(Q) $(MKDIR_P) $@ CPPFLAGS += -DBINDIR='"$(bindir)"' @@ -99,8 +110,8 @@ CPPFLAGS += -DBUILD_DATE='"$(build_date)"' CPPFLAGS += -DLOGLEVELS='$(LOGLEVELS)' CPPFLAGS += -DUNAME_RS='"$(uname_rs)"' CPPFLAGS += -DCC_VERSION='"$(cc_version)"' -CPPFLAGS += -I/usr/local/include CPPFLAGS += -I$(lls_suite_dir) +CPPFLAGS += -I$(yy_build_dir) CPPFLAGS += $(lopsub_cppflags) STRICT_CFLAGS += -fno-strict-aliasing @@ -116,8 +127,6 @@ STRICT_CFLAGS += -Wno-sign-compare -Wno-unknown-pragmas STRICT_CFLAGS += -Wdeclaration-after-statement STRICT_CFLAGS += -Wformat -Wformat-security -Wmissing-format-attribute -LDFLAGS += $(clock_gettime_ldflags) - ifeq ($(uname_s),Linux) # these cause warnings on *BSD CPPFLAGS += -Wunused-macros @@ -134,6 +143,7 @@ cc-option = $(shell \ ) STRICT_CFLAGS += $(call cc-option, -Wformat-signedness) +STRICT_CFLAGS += $(call cc-option, -Wdiscarded-qualifiers) # To put more focus on warnings, be less verbose as default # Use 'make V=1' to see the full commands @@ -180,10 +190,9 @@ $(object_dir)/spx%.o: CPPFLAGS += $(speex_cppflags) $(object_dir)/flac%.o: CPPFLAGS += $(flac_cppflags) $(object_dir)/mp3_afh.o: CPPFLAGS += $(id3tag_cppflags) -$(object_dir)/crypt.o: CPPFLAGS += $(openssl_cppflags) +$(object_dir)/openssl.o: CPPFLAGS += $(openssl_cppflags) $(object_dir)/gcrypt.o: CPPFLAGS += $(gcrypt_cppflags) $(object_dir)/ao_write.o: CPPFLAGS += $(ao_cppflags) -$(object_dir)/aac_afh.o: CPPFLAGS += $(mp4v2_cppflags) $(object_dir)/alsa%.o: CPPFLAGS += $(alsa_cppflags) $(object_dir)/interactive.o \ @@ -202,7 +211,6 @@ $(object_dir)/mp3dec_filter.o \ : CPPFLAGS += $(mad_cppflags) $(object_dir)/aacdec_filter.o \ -$(object_dir)/aac_common.o \ $(object_dir)/aac_afh.o \ : CPPFLAGS += $(faad_cppflags) @@ -238,14 +246,14 @@ $(object_dir)/mm.o \ $(object_dir)/compress_filter.o: CFLAGS += -O3 -$(object_dir)/%.o: %.c | $(object_dir) $(dep_dir) $(lsg_h) +$(object_dir)/%.o: %.c | $(object_dir) $(dep_dir) $(lsg_h) $(yy_h) @[ -z "$(Q)" ] || echo 'CC $<' $(Q) $(CC) -c -o $@ -MMD -MF $(dep_dir)/$(*F).d -MT $@ $(CPPFLAGS) \ $(STRICT_CFLAGS) $(CFLAGS) $< para_recv para_afh para_play para_server: LDFLAGS += $(id3tag_ldflags) para_write para_play para_audiod \ -: LDFLAGS += $(ao_ldflags) $(pthread_ldflags) $(core_audio_ldflags) +: LDFLAGS += $(ao_ldflags) $(pthread_ldflags) para_client para_audioc para_play : LDFLAGS += $(readline_ldflags) para_server: LDFLAGS += $(osl_ldflags) para_gui: LDFLAGS += $(curses_ldflags) @@ -264,6 +272,8 @@ para_play \ $(samplerate_ldflags) \ -lm +para_mixer: LDFLAGS += -lm + para_write \ para_play \ para_audiod \ @@ -299,13 +309,6 @@ para_recv \ $(faad_ldflags) \ $(flac_ldflags) -para_server \ -para_play \ -para_afh \ -para_recv \ -: LDFLAGS += \ - $(mp4v2_ldflags) - para_afh para_recv para_server para_play: LDFLAGS += $(iconv_ldflags) $(foreach exe,$(executables),$(eval para_$(exe): $$($(exe)_objs))) @@ -313,31 +316,36 @@ $(prefixed_executables): @[ -z "$(Q)" ] || echo 'LD $@' $(Q) $(CC) $^ -o $@ $(LDFLAGS) -clean: - @[ -z "$(Q)" ] || echo 'CLEAN' +mostlyclean: + @[ -z "$(Q)" ] || echo 'MOSTLYCLEAN' $(Q) rm -f para_* $(Q) rm -rf $(object_dir) - -clean2: clean - @[ -z "$(Q)" ] || echo 'CLEAN2' +clean: mostlyclean + @[ -z "$(Q)" ] || echo 'CLEAN' $(Q) rm -rf $(build_dir) -distclean: clean2 test-clean +distclean: clean @[ -z "$(Q)" ] || echo 'DISTCLEAN' $(Q) rm -f Makefile autoscan.log config.status config.log - $(Q) rm -f GPATH GRTAGS GSYMS GTAGS - + $(Q) rm -f config.h configure config.h.in maintainer-clean: distclean @[ -z "$(Q)" ] || echo 'MAINTAINER-CLEAN' - $(Q) rm -f *.tar.bz2 config.h configure config.h.in + $(Q) rm -f *.tar.bz2 *.tar.xz + $(Q) rm -f GPATH GRTAGS GSYMS GTAGS + +INSTALL ?= install +INSTALL_PROGRAM ?= $(INSTALL) +INSTALL_DATA ?= $(INSTALL) -m 644 +ifneq ($(findstring strip, $(MAKECMDGOALS)),) + strip_option := -s +endif -install: all man - $(MKDIR_P) $(bindir) $(mandir) - $(INSTALL) -s --strip-program $(STRIP) -m 755 \ - $(prefixed_executables) $(bindir) - $(INSTALL) -m 644 $(man_pages) $(mandir) - $(MKDIR_P) $(vardir) >/dev/null 2>&1 || true # not fatal, so don't complain +install install-strip: all man + $(MKDIR_P) $(DESTDIR)$(bindir) $(DESTDIR)$(mandir) + $(INSTALL) $(strip_option) $(prefixed_executables) $(DESTDIR)$(bindir) + $(INSTALL_DATA) $(man_pages) $(DESTDIR)$(mandir) + $(MKDIR_P) $(DESTDIR)$(vardir) >/dev/null 2>&1 || true # not fatal, so don't complain -$(tarball): +$(tarball) dist tarball: $(Q) rm -rf $(tarball) $(tarball_pfx) $(Q) git archive --format=tar --prefix=$(tarball_pfx)/ HEAD \ | tar --delete $(tarball_delete) > $(tarball_pfx).tar @@ -345,7 +353,7 @@ $(tarball): $(Q) ./GIT-VERSION-GEN > $(tarball_pfx)/VERSION $(Q) cp $(autocrap) $(tarball_pfx) $(Q) tar rf $(tarball_pfx).tar $(tarball_pfx)/* - $(Q) bzip2 -9 $(tarball_pfx).tar + $(Q) xz -9 $(tarball_pfx).tar $(Q) ls -l $(tarball) - $(Q) ln -sf $(tarball) paraslash-git.tar.bz2 + $(Q) ln -sf $(tarball) paraslash-git.tar.xz $(Q) rm -rf $(tarball_pfx)