Skip to content

Commit

Permalink
Makefile: prepend DESTDIR to INSTALLDIRx variables
Browse files Browse the repository at this point in the history
This allows the files to be first staged instead of being directly
installed into the path specified in INSTALLPREFIX.

The purpose is to allow the FreeBSD ports Makefile to cleanly install
the files into the stagedir without hacks.

Sponsored by:	The FreeBSD Foundation
  • Loading branch information
khng300 committed Jan 26, 2022
1 parent 724dc69 commit f7fd32e
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -110,16 +110,16 @@ depend:
makedepend -f$(MAKEFILE_LIST) -Y $(OBJS:.o=.c) 2>/dev/null

install: $(HEADERS) $(STATICLIB) $(SHAREDLIB) natpmpc-shared natpmp.pc
$(INSTALL) -d $(INSTALLDIRINC)
$(INSTALL) -m 644 $(HEADERS) $(INSTALLDIRINC)
$(INSTALL) -d $(INSTALLDIRLIB)
$(INSTALL) -m 644 $(STATICLIB) $(INSTALLDIRLIB)
$(INSTALL) -m 644 $(SHAREDLIB) $(INSTALLDIRLIB)/$(SONAME)
$(INSTALL) -d $(DESTDIR)$(INSTALLDIRINC)
$(INSTALL) -m 644 $(HEADERS) $(DESTDIR)$(INSTALLDIRINC)
$(INSTALL) -d $(DESTDIR)$(INSTALLDIRLIB)
$(INSTALL) -m 644 $(STATICLIB) $(DESTDIR)$(INSTALLDIRLIB)
$(INSTALL) -m 644 $(SHAREDLIB) $(DESTDIR)$(INSTALLDIRLIB)/$(SONAME)
$(INSTALL) -d $(DESTDIR)$(PKGCONFIGDIR)
$(INSTALL) -m 644 natpmp.pc $(DESTDIR)$(PKGCONFIGDIR)
$(INSTALL) -d $(INSTALLDIRBIN)
$(INSTALL) -m 755 natpmpc-shared $(INSTALLDIRBIN)/natpmpc
ln -s -f $(SONAME) $(INSTALLDIRLIB)/$(SHAREDLIB)
$(INSTALL) -d $(DESTDIR)$(INSTALLDIRBIN)
$(INSTALL) -m 755 natpmpc-shared $(DESTDIR)$(INSTALLDIRBIN)/natpmpc
ln -s -f $(SONAME) $(DESTDIR)$(INSTALLDIRLIB)/$(SHAREDLIB)

$(JNIHEADERS): fr/free/miniupnp/libnatpmp/NatPmp.class
$(JAVAH) -jni fr.free.miniupnp.libnatpmp.NatPmp
Expand Down Expand Up @@ -169,11 +169,11 @@ mvn_install:
-DcreateChecksum=true

cleaninstall:
$(RM) $(addprefix $(INSTALLDIRINC), $(HEADERS))
$(RM) $(INSTALLDIRLIB)/$(SONAME)
$(RM) $(INSTALLDIRLIB)/$(SHAREDLIB)
$(RM) $(INSTALLDIRLIB)/$(STATICLIB)
$(RM) $(INSTALLDIRLIB)/$(PKGCONFIGDIR)
$(RM) $(addprefix $(DESTDIR)$(INSTALLDIRINC)/, $(HEADERS))
$(RM) $(DESTDIR)$(INSTALLDIRLIB)/$(SONAME)
$(RM) $(DESTDIR)$(INSTALLDIRLIB)/$(SHAREDLIB)
$(RM) $(DESTDIR)$(INSTALLDIRLIB)/$(STATICLIB)
$(RM) $(DESTDIR)$(PKGCONFIGDIR)

natpmp.pc: VERSION
$(RM) $@
Expand Down

0 comments on commit f7fd32e

Please sign in to comment.