diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2021-06-01 10:47:29 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2021-06-01 10:47:29 -0700 |
commit | ad0b7a7d38d77f0cb90e1509e2eb56a6cbb8db75 (patch) | |
tree | c50f492d49243200e0a9b87f7808582f3d4f1e59 /Makefile | |
parent | 7b6dae900bb4a2cb260362bad29728050c201164 (diff) | |
download | txr-ad0b7a7d38d77f0cb90e1509e2eb56a6cbb8db75.tar.gz txr-ad0b7a7d38d77f0cb90e1509e2eb56a6cbb8db75.tar.bz2 txr-ad0b7a7d38d77f0cb90e1509e2eb56a6cbb8db75.zip |
build: improved mechanism for copying .shipped files.
* Makefile (SHIPPED): New variable, holds names of files that
get copied to a .shipped suffix and commited to the repo.
(ABBREV3SH): New macro, version of ABBREV3 that doesn't assume
it is expanding an entire recipe line, and thus can be
embedded into shell commands.
(%.shipped): Rule removed.
(shipped): New rule that prints what it is copying.
Non-maintainer version of rule errors out.
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 12 |
1 files changed, 9 insertions, 3 deletions
@@ -81,6 +81,8 @@ SRCS := $(addprefix $(top_srcdir),\ ls-files "*.c" "*.h" "*.l" "*.y"))) endif +SHIPPED := lex.yy.c y.tab.c y.tab.h + # MPI objects MPI_OBJ_BASE=mpi.o @@ -110,6 +112,7 @@ ABBREVN = $(if $(VERBOSE),\ @printf "%s %s -> %s\n" $(1) \ "$(patsubst $(top_srcdir)%,%,$(filter-out $(DEP_$@),$^))" $@) ABBREV3 = $(if $(VERBOSE),@:,@printf "%s %s -> %s\n" $(1) "$(3)" $(2)) +ABBREV3SH = $(if $(VERBOSE),:,printf "%s %s -> %s\n" $(1) "$(3)" $(2)) define DEPGEN $(V)sed -e ':x' \ @@ -289,9 +292,12 @@ lex.yy.c: $(top_srcdir)parser.l false ; \ fi) -%.shipped: $(top_srcdir)% - $(call ABBREV,COPY) - $(call SH,[ $^ -nt $@ ] && cp $^ $@) +shipped: + $(V)$(foreach NAME,$(SHIPPED), \ + if ! cmp -s $(NAME) $(NAME).shipped; then \ + $(call ABBREV3SH,COPY,$(NAME),$(NAME).shipped); \ + cp $(NAME) $(NAME).shipped; \ + fi;) else |