-
Notifications
You must be signed in to change notification settings - Fork 99
Expand file tree
/
Copy pathMakefile.maint
More file actions
47 lines (36 loc) · 1.68 KB
/
Makefile.maint
File metadata and controls
47 lines (36 loc) · 1.68 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# -*-Makefile-*-
# Makefile fragment to generate makefile.all and update version.c
# Non-core sources and version.c
noncoresrc = bf_test.c gpexecute.c gplt_x11.c version.c vms.c vms.h
coresrc := $(sort $(filter-out $(noncoresrc),$(wildcard *.c)))
coreterm := $(shell cd ../term && echo *.trm | sort)
version := $(PACKAGE_VERSION)
file_version := $(shell sed -n 's/.*gnuplot_version.*"\(.*\)".*/\1/p' ./version.c|tr -d ' ')
patchlevel := $(shell cat $(top_srcdir)/PATCHLEVEL)
file_pl := $(shell sed -n 's/.*gnuplot_patchlevel.*"\(.*\)".*/\1/p' ./version.c|tr -d ' ')
last_change := $(shell dd if=$(top_srcdir)/ChangeLog bs=11 count=1 2> /dev/null)
date := $(shell date)
makefile.all: $(srcdir)/Makefile.maint
@echo "# $@ generated automatically by GNU make" >$@t
@echo >>$@t
@echo '# List of core object files except version.$$(O)' >>$@t
@echo COREOBJS = $(coresrc:.c=.'$$(O)') \
| fmt | (tr '\012' @; echo) | sed 's/@$$/%/;s/@/ \\@/g' \
| tr @% '\012\012' >>$@t
@echo "# List of terminal driver sources" >>$@t
@echo CORETERM = $(patsubst %.trm,$$\(T\)%.trm,$(coreterm)) \
| fmt | (tr '\012' @; echo) | sed 's/@$$/%/;s/@/ \\@/g' \
| tr @% '\012\012' >>$@t
@if cmp -s $@ $@t; then rm -f $@t; else mv $@t $@; fi
makefile.awc: makefile.all
sed -e 's/\\/\&/g' makefile.all > $@
version.c: $(top_srcdir)/PATCHLEVEL
@echo Making $@
@if [ "$(version)" != "$(file_version)" -o \
"$(patchlevel)" != "$(file_pl)" ]; then \
sed -e '/^const char gnuplot_version/ s/"[^"]*"/"@VERS@"/' \
-e '/^const char gnuplot_patchlevel/ s/"[^"]*"/"@PLVL@"/' \
-e "s/@VERS@/$(version)/" -e "s/@PLVL@/$(patchlevel)/" \
$@ >$@t; \
if cmp -s $@ $@t; then rm -f $@t; else mv $@t $@; fi \
fi