makefileinstallationmkdirnetbsd

NetBSD: "make install" with bsd.*.mk scripts: How to automatically create non-existing directories


On a NetBSD system I have a makefile with no install target. Included makefiles are

bsd.xconf.mk
bsd.prog.mk
bsd.xorg.mk

The following relevant variables are set

PROG
BINDIR
MANDIR
MAN

When I type

make install

PROG is installed in BINDIR and files in MAN are installed in MANDIR. But if BINDIR or MANDIR do not exist they are not created.

What do I need to specify in the Makefile for creating non-existing directories? (Of course writing a install target would work but I would like to use the automatism from the .mk scripts.)

I tried e.g. to set variables

INSTALL_MAN_DIR
INSTALLATION_DIRS

but nothing works.


Solution

  • Mayby you should install it manually.

    PROG = xxxxx
    DESTDIR = /usr/local/test/make
    BINDIR = /bin
    
    include bsd.prog.mk
    
    beforeinstall:
        ${INSTALL} -d $(DESTDIR)$(BINDIR)