lout-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] Make makefile working even with distro packaging systems.


From: William Bader
Subject: Re: [PATCH] Make makefile working even with distro packaging systems.
Date: Wed, 22 May 2024 02:32:53 +0000

I have something similar in https://github.com/william8000/lout
with the addition of a contributed change to add a $(DESTDIR) prefix to simplify creating rpms.
---
$ grep -i mkdir makefile
MKDIR      = mkdir -p
        if [ ! -d $(DESTDIR)$(BINDIR) ] ; then $(MKDIR) $(DESTDIR)$(BINDIR) ; chmod 755 $(DESTDIR)$(BINDIR) ; fi
        $(MKDIR) $(DESTDIR)$(LOUTLIBDIR)
        $(MKDIR) $(DESTDIR)$(LOUTLIBDIR)/$(LIBINCL)
        $(MKDIR) $(DESTDIR)$(LOUTLIBDIR)/$(LIBDATA)
        $(MKDIR) $(DESTDIR)$(LOUTLIBDIR)/$(LIBHYPH)
        $(MKDIR) $(DESTDIR)$(LOUTLIBDIR)/$(LIBFONT)
        $(MKDIR) $(DESTDIR)$(LOUTLIBDIR)/$(LIBMAPS)
        $(MKDIR) $(DESTDIR)$(LOUTLIBDIR)/$(LIBLOCA)
        if [ ! -d $(DESTDIR)$(MANDIR) ] ; then $(MKDIR) $(DESTDIR)$(MANDIR) ; fi
        if [ ! -d $(DESTDIR)$(LOUTDOCDIR) ] ; then $(MKDIR) $(DESTDIR)$(LOUTDOCDIR) ; fi
        $(MKDIR) $(DESTDIR)$(LOUTLIBDIR)/$(LIBLOCA)/$(LOC_FR)
        $(MKDIR) $(DESTDIR)$(LOUTLIBDIR)/$(LIBLOCA)/$(LOC_FR)/LC_MESSAGES
        $(MKDIR) $(DESTDIR)$(LOUTLIBDIR)/$(LIBLOCA)/$(LOC_DE)
        $(MKDIR) $(DESTDIR)$(LOUTLIBDIR)/$(LIBLOCA)/$(LOC_DE)/LC_MESSAGES
---
Is there anything that I should update in my repository?
Regards,
William



From: lout-users-bounces+williambader=hotmail.com@nongnu.org <lout-users-bounces+williambader=hotmail.com@nongnu.org> on behalf of Matěj Cepl <mcepl@cepl.eu>
Sent: Saturday, May 18, 2024 7:01 PM
To: lout-users@nongnu.org <lout-users@nongnu.org>
Cc: Matěj Cepl <mcepl@cepl.eu>
Subject: [PATCH] Make makefile working even with distro packaging systems.
 
Signed-off-by: Matěj Cepl <mcepl@cepl.eu>
---
 makefile | 34 +++++++++++++++++++---------------
 1 file changed, 19 insertions(+), 15 deletions(-)

diff --git a/makefile b/makefile
index 9e4edd0..1c3dfa7 100644
--- a/makefile
+++ b/makefile
@@ -355,39 +355,43 @@ install: lout prg2lout
         chmod 755 $(BINDIR)/prg2lout
         @echo ""
         @echo "(b) Installing library files into LOUTLIBDIR $(LOUTLIBDIR)"
-       mkdir $(LOUTLIBDIR)
+       mkdir -p $(LOUTLIBDIR)
         chmod 755 $(LOUTLIBDIR)
         @echo ""
-       mkdir $(LOUTLIBDIR)/$(LIBINCL)
+       mkdir -p $(LOUTLIBDIR)/$(LIBINCL)
         chmod 755 $(LOUTLIBDIR)/$(LIBINCL)
         cp include/* $(LOUTLIBDIR)/$(LIBINCL)
         chmod 644 $(LOUTLIBDIR)/$(LIBINCL)/*
         @echo ""
-       mkdir $(LOUTLIBDIR)/$(LIBDATA)
+       mkdir -p $(LOUTLIBDIR)/$(LIBDATA)
         chmod 755 $(LOUTLIBDIR)/$(LIBDATA)
         cp data/* $(LOUTLIBDIR)/$(LIBDATA)
         chmod 644 $(LOUTLIBDIR)/$(LIBDATA)/*
         @echo ""
-       mkdir $(LOUTLIBDIR)/$(LIBHYPH)
+       mkdir -p $(LOUTLIBDIR)/$(LIBHYPH)
         chmod 755 $(LOUTLIBDIR)/$(LIBHYPH)
         cp hyph/* $(LOUTLIBDIR)/$(LIBHYPH)
         chmod 644 $(LOUTLIBDIR)/$(LIBHYPH)/*
         @echo ""
-       mkdir $(LOUTLIBDIR)/$(LIBFONT)
+       mkdir -p $(LOUTLIBDIR)/$(LIBFONT)
         chmod 755 $(LOUTLIBDIR)/$(LIBFONT)
         cp font/* $(LOUTLIBDIR)/$(LIBFONT)
         chmod 644 $(LOUTLIBDIR)/$(LIBFONT)/*
         @echo ""
-       mkdir $(LOUTLIBDIR)/$(LIBMAPS)
+       mkdir -p $(LOUTLIBDIR)/$(LIBMAPS)
         chmod 755 $(LOUTLIBDIR)/$(LIBMAPS)
         cp maps/* $(LOUTLIBDIR)/$(LIBMAPS)
         chmod 644 $(LOUTLIBDIR)/$(LIBMAPS)/*
         @echo ""
-       mkdir $(LOUTLIBDIR)/$(LIBLOCA)
+       mkdir -p $(LOUTLIBDIR)/$(LIBLOCA)
         chmod 755 $(LOUTLIBDIR)/$(LIBLOCA)
         @echo ""
         @echo "(c) Initializing run (should be silent, no errors expected)"
-       $(BINDIR)/lout -x -s $(LOUTLIBDIR)/$(LIBINCL)/init
+       $(BINDIR)/lout \
+               -D $(LOUTLIBDIR)/$(LIBDATA) \
+               -I $(LOUTLIBDIR)/$(LIBINCL) \
+               -H $(LOUTLIBDIR)/$(LIBHYPH) \
+               -x -s $(LOUTLIBDIR)/$(LIBINCL)/init
         @echo ""
         @echo "(d) Changing mode of files just created by initializing run"
         chmod 644 $(LOUTLIBDIR)/$(LIBDATA)/*
@@ -396,6 +400,7 @@ install: lout prg2lout
 installman:
         @echo ""
         @echo "Installing manual entries into MANDIR $(MANDIR)"
+       mkdir -p $(MANDIR)
         sed -e "s@<BINDIR>@$(BINDIR)@" -e "s@<LIBDIR>@$(LOUTLIBDIR)@"   \
             -e "s@<LOUTDOCDIR>@$(LOUTDOCDIR)@" -e "s@<MANDIR>@$(MANDIR)@"        \
         man/lout.1 > $(MANDIR)/lout.1
@@ -406,19 +411,18 @@ installman:
 installdoc:
         @echo ""
         @echo "Creating LOUTDOCDIR $(LOUTDOCDIR) and copying documentation into it"
+       mkdir -p $(LOUTDOCDIR)
         $(RCOPY) doc/* $(LOUTDOCDIR)
-       chmod 755 $(LOUTDOCDIR)
-       chmod 755 $(LOUTDOCDIR)/*
-       chmod 644 $(LOUTDOCDIR)/*/*
+       chmod -Rf a+rX,g-w,o-w $(LOUTDOCDIR)
 
 allinstall:     install installman installdoc
 
 installfr:
         @echo ""
         @echo "Putting French error messages into $(LOUTLIBDIR)/$(LIBLOCA)/$(LOC_FR)"
-       mkdir $(LOUTLIBDIR)/$(LIBLOCA)/$(LOC_FR)
+       mkdir -p $(LOUTLIBDIR)/$(LIBLOCA)/$(LOC_FR)
         chmod 755 $(LOUTLIBDIR)/$(LIBLOCA)/$(LOC_FR)
-       mkdir $(LOUTLIBDIR)/$(LIBLOCA)/$(LOC_FR)/LC_MESSAGES
+       mkdir -p $(LOUTLIBDIR)/$(LIBLOCA)/$(LOC_FR)/LC_MESSAGES
         chmod 755 $(LOUTLIBDIR)/$(LIBLOCA)/$(LOC_FR)/LC_MESSAGES
         cp locale/msgs.fr $(LOUTLIBDIR)/$(LIBLOCA)/$(LOC_FR)/LC_MESSAGES/msgs.$(LOC_FR)
         gencat $(LOUTLIBDIR)/$(LIBLOCA)/$(LOC_FR)/LC_MESSAGES/errors.$(LOC_FR)  \
@@ -428,9 +432,9 @@ installfr:
 installde:
         @echo ""
         @echo "Putting German error messages into $(LOUTLIBDIR)/$(LIBLOCA)/$(LOC_DE)"
-       mkdir $(LOUTLIBDIR)/$(LIBLOCA)/$(LOC_DE)
+       mkdir -p $(LOUTLIBDIR)/$(LIBLOCA)/$(LOC_DE)
         chmod 755 $(LOUTLIBDIR)/$(LIBLOCA)/$(LOC_DE)
-       mkdir $(LOUTLIBDIR)/$(LIBLOCA)/$(LOC_DE)/LC_MESSAGES
+       mkdir -p $(LOUTLIBDIR)/$(LIBLOCA)/$(LOC_DE)/LC_MESSAGES
         chmod 755 $(LOUTLIBDIR)/$(LIBLOCA)/$(LOC_DE)/LC_MESSAGES
         cp locale/msgs.de $(LOUTLIBDIR)/$(LIBLOCA)/$(LOC_DE)/LC_MESSAGES/msgs.$(LOC_DE)
         gencat $(LOUTLIBDIR)/$(LIBLOCA)/$(LOC_DE)/LC_MESSAGES/errors.$(LOC_DE)  \
--
2.45.1



reply via email to

[Prev in Thread] Current Thread [Next in Thread]