X-Git-Url: http://git.tuebingen.mpg.de/?a=blobdiff_plain;f=Makefile.real;h=e5ecfe4290118d83aa23b6bca4f69647f0f1f283;hb=3bc858ee0d9b929f4cbca61cf5ed8d3184d0cf78;hp=c8d30aae7f6d2171e8c45bc037da88512562f92b;hpb=ece3b9ff875a28473a4f840bb016f8debb2531fc;p=paraslash.git diff --git a/Makefile.real b/Makefile.real index c8d30aae..e5ecfe42 100644 --- a/Makefile.real +++ b/Makefile.real @@ -20,7 +20,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 := 2018 +COPYRIGHT_YEAR := 2022 ifeq ("$(origin O)", "command line") build_dir := $(O) @@ -55,6 +55,7 @@ gui_objs += gui.lsg.o play_objs += $(addsuffix _cmd.lsg.o, recv filter play write) play.lsg.o recv_objs += recv_cmd.lsg.o recv.lsg.o server_objs += server_cmd.lsg.o server.lsg.o +upgrade_db_objs += upgrade_db.lsg.o write_objs += write_cmd.lsg.o write.lsg.o cmd_suites := $(addsuffix _cmd, audiod server play recv filter write) @@ -77,6 +78,7 @@ audiod_objs := $(addprefix $(object_dir)/, $(audiod_objs)) audioc_objs := $(addprefix $(object_dir)/, $(audioc_objs)) mixer_objs := $(addprefix $(object_dir)/, $(mixer_objs)) server_objs := $(addprefix $(object_dir)/, $(server_objs)) +upgrade_db_objs := $(addprefix $(object_dir)/, $(upgrade_db_objs)) write_objs := $(addprefix $(object_dir)/, $(write_objs)) afh_objs := $(addprefix $(object_dir)/, $(afh_objs)) play_objs := $(addprefix $(object_dir)/, $(play_objs)) @@ -112,7 +114,6 @@ 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) @@ -130,6 +131,11 @@ STRICT_CFLAGS += -Wno-sign-compare -Wno-unknown-pragmas STRICT_CFLAGS += -Wdeclaration-after-statement STRICT_CFLAGS += -Wformat -Wformat-security -Wmissing-format-attribute +ifeq ($(ENABLE_UBSAN), yes) + STRICT_CFLAGS += -fsanitize=undefined + LDFLAGS += -lubsan +endif + ifeq ($(uname_s),Linux) # these cause warnings on *BSD CPPFLAGS += -Wunused-macros @@ -193,7 +199,7 @@ $(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)/alsa%.o: CPPFLAGS += $(alsa_cppflags) @@ -249,16 +255,25 @@ $(object_dir)/mm.o \ $(object_dir)/compress_filter.o: CFLAGS += -O3 -$(object_dir)/%.o: %.c | $(object_dir) $(dep_dir) $(lsg_h) $(yy_h) +define CC_CMD $(call SAY, CC $<) - $(CC) -c -o $@ -MMD -MF $(dep_dir)/$(*F).d -MT $@ $(CPPFLAGS) \ - $(STRICT_CFLAGS) $(CFLAGS) $< + $(CC) -c -o $(object_dir)/$(*F).o -MMD -MF \ + $(dep_dir)/$(*F).d -MT $(object_dir)/$(*F).o \ + $(CPPFLAGS) $(STRICT_CFLAGS) $(CFLAGS) $< +endef +CC_PREREQUISITES := %.c | $(object_dir) $(dep_dir) $(lsg_h) $(yy_h) +# These two have the same prerequisites and the same recipe. There should be a +# better way to write this. +$(object_dir)/%.o: $(CC_PREREQUISITES) + $(CC_CMD) +$(dep_dir)/%.d: $(CC_PREREQUISITES) + $(CC_CMD) para_recv para_afh para_play para_server: LDFLAGS += $(id3tag_ldflags) para_write para_play para_audiod \ : LDFLAGS += $(ao_ldflags) $(pthread_ldflags) para_client para_audioc para_play : LDFLAGS += $(readline_ldflags) -para_server: LDFLAGS += $(osl_ldflags) +para_server para_upgrade_db: LDFLAGS += $(osl_ldflags) para_gui: LDFLAGS += $(curses_ldflags) para_server \ para_client \ @@ -295,6 +310,7 @@ para_gui \ para_play \ para_recv \ para_server \ +para_upgrade_db \ para_write \ : LDFLAGS += $(lopsub_ldflags)