PDA

View Full Version : qmake "make dist" not including my DISTFILES



taraj
15th February 2024, 03:55
Hello,

I have a .pro file and in it i declare some DISTFILES. some of these files are from the current directory and some are from another directory (../bin/)


DISTFILES += \
a_status.sh \
a_tracks.sh \
a_monitor.sh \
../bin/AApp \
../bin/LApp.xml[/CODE]

when i do a qmake I can see them all in the Makefile:


DIST = a_status.sh \
a_tracks.sh \
a_monitor.sh \
../bin/AApp \
../bin/LApp.xml \

Then i do a make dist and when i look in the tar.gz file all files are there except for the 2 files from the ../bin directory which are not there. If i put the 2 files in the same directory as the scripts it works fine (but i don't want to do this) so when I do a rpmbuild -ta xxxNumber.tar.gz, this then of course fails as there is no ../bin/* files.

How do i get it to include files from other directories other than the directory the .pro file lives in?

Thank you.

yogeshgokul
23rd February 2024, 08:28
You can try and play with a couple of options and see. Just for testing:

1. Try to remove all other files and keep only 1 file in your DISTFILES list, like DISTFILES = ../bin/LApp.xml
2. Try to enlist the files comma or space separated
3. Try to make multiple +=(append) into the variable DISTFILES

taraj
26th February 2024, 05:25
Thanks for the reply. It got me thinking and the problem is in the Makefile.
It looks like this:



COPY_FILE = cp -f -R

dist: distdir FORCE
(cd `dirname $(DISTDIR)` && $(TAR) $(DISTNAME).tar $(DISTNAME) && $(COMPRESS) $(DISTNAME).tar) && $(MOVE) `dirname $(DISTDIR)`/$(DISTNAME).tar.gz . && $(DEL_FILE) #-r $(DISTDIR)
distdir: FORCE
@test -d $(DISTDIR) || mkdir -p $(DISTDIR)
$(COPY_FILE) --parents $(DIST) $(DISTDIR)/
$(COPY_FILE) --parents /../lib64/qt5/mkspecs/features/data/dummy.cpp $(DISTDIR)/
$(COPY_FILE) --parents <a list of my header files> $(DISTDIR)/
$(COPY_FILE) --parents <a list of my source files> $(DISTDIR)/

From my source directory I run the test command
cp -f -R --parents ../bin/LApp.xml /tmp

and it fails to copy the file to the tmp directory.

I would have thought the copy options would have been able to handle copying the LApp.xml file? But no.

If i remove the --parents from this line ($(COPY_FILE) --parents $(DIST) $(DISTDIR)/) then it works...

but my problem now is that my Makefile is generated from a .pro with qmake.... how do I get it to remove the --parents from the line in the Makefile without having to manually remove it every time i do a qmake?

Thanks.