Do not use full paths in Makefile.am. Ever. You can tell automake to put datafile1
in $(datadir)
, which will expand to $(prefix)/share/MyProduct
, or you can define flash_DIR
to expand it to $(prefix)/MyProduct/flash_memory
, and put the files there, but the end user should be able to install $(prefix)
either on /usr
or something else. What do you want to do in Makefile.am:
flashdir = $(prefix)/$(PACKAGE)/flash_memory flash_DATA = datafile1
(It might be more appropriate to use $(prefix)/@ PACKAGE@ /flash_memory
, since PACKAGE probably cannot be changed at runtime, but I don't think this is very important.)
Then, when you are a user, run make install
with the prefix set to /usr
. If you try to use the absolute path in Makefile.am, it will prohibit a phased installation (i.e. Installing DESTDIR), it will limit the flexibility of the user and this is wrong. The main thing is that the package supporter cannot choose the final location; This is a solution for the user.
source share