backend/Makefile: Improve rules for pixma/pixma_sane_options.{c,h}

Ensure these files are updated after pixma/pixma.c is changed. Do not
remove them during "make clean" or "make distclean", because they are
part of the source distribution (generated with "make dist"). Display
the relative paths in the build output.
escl-add-user-and-password
David Ward 2022-04-24 22:52:55 -04:00
rodzic 28b5aa7dee
commit adac4f23e6
2 zmienionych plików z 23 dodań i 22 usunięć

Wyświetl plik

@ -18,6 +18,8 @@ DIST_LIBS_LDFLAGS = $(AM_LDFLAGS) -rpath '$(libdir)' -version-number $(V_MAJOR):
LIBTOOL += --silent LIBTOOL += --silent
FIRMWARE_DIRS = artec_eplus48u gt68xx snapscan epjitsu FIRMWARE_DIRS = artec_eplus48u gt68xx snapscan epjitsu
BUILT_SOURCES =
# Needed by most backends as they add sane_strstatus.lo to their list # Needed by most backends as they add sane_strstatus.lo to their list
# of libraries to link with via libsane_${BACKEND}_la_LIBADD. Due to # of libraries to link with via libsane_${BACKEND}_la_LIBADD. Due to
# the implicit dependency, automake does not notice the need to clean # the implicit dependency, automake does not notice the need to clean
@ -1429,7 +1431,9 @@ libsane_pint_la_LIBADD = $(COMMON_LIBS) \
../sanei/sanei_config.lo \ ../sanei/sanei_config.lo \
sane_strstatus.lo sane_strstatus.lo
libpixma_la_SOURCES = pixma/pixma.c \ libpixma_la_SOURCES = \
pixma/pixma_sane_options.h \
pixma/pixma.c \
pixma/pixma.h \ pixma/pixma.h \
pixma/pixma_io_sanei.c \ pixma/pixma_io_sanei.c \
pixma/pixma_io.h \ pixma/pixma_io.h \
@ -1446,28 +1450,25 @@ libpixma_la_SOURCES = pixma/pixma.c \
pixma/pixma_rename.h pixma/pixma_rename.h
libpixma_la_CPPFLAGS = $(AM_CPPFLAGS) $(XML_CFLAGS) -DBACKEND_NAME=pixma libpixma_la_CPPFLAGS = $(AM_CPPFLAGS) $(XML_CFLAGS) -DBACKEND_NAME=pixma
# Generate options files included by pixma/pixma.c from said file. $(srcdir)/pixma/pixma_sane_options.h: $(srcdir)/pixma/pixma.c
# The circular dependency means we cannot add it as a prerequisite @if $(AM_V_P); then \
# for the targets that build the options files. echo "Generating pixma/$(@F) from pixma/$(^F)"; \
else \
$(srcdir)/pixma/pixma.c: \ echo " GEN pixma/$(@F)"; \
$(srcdir)/pixma/pixma_sane_options.h \ fi
$(srcdir)/pixma/pixma_sane_options.c @$(PYTHON) $(srcdir)/pixma/scripts/pixma_gen_options.py h < $^ > $@
$(srcdir)/pixma/pixma_sane_options.c: $(srcdir)/pixma/pixma.c
$(srcdir)/pixma/pixma_sane_options.h: @if $(AM_V_P); then \
$(AM_V_GEN) echo "Generating pixma/$(@F) from pixma/$(^F)"; \
@if $(AM_V_P); then echo Generating $@ from $(@D)/pixma.c; fi else \
@(cd $(@D); $(PYTHON) scripts/pixma_gen_options.py h < pixma.c > $(@F)) echo " GEN pixma/$(@F)"; \
$(srcdir)/pixma/pixma_sane_options.c: fi
$(AM_V_GEN) @$(PYTHON) $(srcdir)/pixma/scripts/pixma_gen_options.py < $^ > $@
@if $(AM_V_P); then echo Generating $@ from $(@D)/pixma.c; fi
@(cd $(@D); $(PYTHON) scripts/pixma_gen_options.py < pixma.c > $(@F))
BUILT_SOURCES += pixma/pixma_sane_options.c
BUILT_SOURCES += pixma/pixma_sane_options.h
EXTRA_DIST += pixma/pixma_sane_options.c EXTRA_DIST += pixma/pixma_sane_options.c
EXTRA_DIST += pixma/pixma_sane_options.h
EXTRA_DIST += pixma/scripts/pixma_gen_options.py EXTRA_DIST += pixma/scripts/pixma_gen_options.py
CLEANFILES += pixma/pixma_sane_options.c
CLEANFILES += pixma/pixma_sane_options.h
nodist_libsane_pixma_la_SOURCES = pixma-s.c nodist_libsane_pixma_la_SOURCES = pixma-s.c
libsane_pixma_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=pixma libsane_pixma_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=pixma
@ -1969,7 +1970,7 @@ libdll_la_SOURCES = dll.c
libdll_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=dll libdll_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=dll
libdll_la_LIBADD = ../sanei/sanei_usb.lo \ libdll_la_LIBADD = ../sanei/sanei_usb.lo \
$(USB_LIBS) $(XML_LIBS) $(USB_LIBS) $(XML_LIBS)
BUILT_SOURCES = dll-preload.h BUILT_SOURCES += dll-preload.h
CLEANFILES += dll-preload.h CLEANFILES += dll-preload.h
nodist_libsane_dll_la_SOURCES = dll-s.c nodist_libsane_dll_la_SOURCES = dll-s.c

Wyświetl plik

@ -52,4 +52,4 @@ EXTRA_LOCALE_CATEGORIES =
# Selected files in POTFILES.in are generated. Make sure they are # Selected files in POTFILES.in are generated. Make sure they are
# available when needed. # available when needed.
$(top_srcdir)/backend/pixma/pixma_sane_options.c: $(top_srcdir)/backend/pixma/pixma_sane_options.c:
cd ../backend; make pixma/pixma_sane_options.c $(MAKE) -C ../backend pixma/pixma_sane_options.c