Patch from Ralf Corsepius <corsepiu@faw.uni-ulm.de>. Comments:

* Added support for bsd "install" ($(BSDINSTALL)) to host.cfg.in, i.e.
    the standard "install" program that most packages (including automake)
    use. In Makefiles outside of rtems, "install" normally is referenced by
    $(INSTALL), but rtems already uses $(INSTALL) for install-if-change,
    hence I used $(BSDINSTALL) instead to keep up backward compatibility.

    * Removed references to @GREP@ etc. from host.cfg.in, as configure.in
    doesn't check for them (Minor cleanup).

    * Added installation flags INST*FLAGS to host.cfg.in, which should
    replace -m XXXX flags for installation calls.

    *Changes to gcc.cfg to enable it to build host programs from multiple
    sources files.
    Should not disturb existing sources, but neccessary.

    * There was a not-so-minor bug in the configuration files: "make
    install" and "make debug_install" don't work in all subdirectories!! I
    tried to fix this by adding "install" to MTARGETS in main.cfg, which
    seems to solve most of the problems. But there still seem to be rare (?)
    cases where "make debug_install" still seems to have problems.

    * Changes to many host related tool-Makefiles to demonstrate the
    abilities of INST*FLAGS, BSDINSTALL and the new rules in gcc.cfg.
    ..of cause ... but BSDINSTALL is THE standard method to install files
    in most program packages besides rtems. This part of the patch fixes
    some minor protection setting problems, but doesn't support
    TARGET_VARIANTS

    NOTE:
    I hope you will like the BSDINSTALL, INST*FLAGS stuff. It is a step to
    get rid of "install-if-change" and to rely on a more standard
    installation procedure. If you don't like BSDINSTALL, removing it from
    the patch isn't  difficult-  just grep for BSDINSTALL and replace
    BSDINSTALL with INSTALL or MKDIR.


    FINALLY:
    I still have another patch pending (well, not a complete patch yet, it's
    a partial patch to demonstrate the principle), which adds automatic
    rebuilding of files generated by autoconf/configure. At the moment I
    don't dare to submit it, because integrating this patch would require to
    modify all Makefile.ins because we'd need to add a new "include " line
    to each Makefile.in.
This commit is contained in:
Joel Sherrill
1998-07-17 15:49:12 +00:00
parent 8123c63506
commit f95d2b53f2
17 changed files with 51 additions and 38 deletions

View File

@@ -18,10 +18,9 @@ INSTALLED=$(DESTDIR)/ifc.exe \
$(DESTDIR)/fixtimer.exe
all: $(DESTDIR) $(PGMS) install
echo $(DESTDIR)
$(DESTDIR):
[ -d $@ ] || $(MKDIR) $@
$(BSDINSTALL) $(INSTDIRFLAGS) $@
install: $(INSTALLED)

View File

@@ -23,10 +23,9 @@ PGMS=install-if-change rcs-clean lock-directory unlock-directory \
INSTALLED=$(PGMS:%=$(DESTDIR)/%)
all: $(DESTDIR) $(PGMS) install
echo $(DESTDIR)
$(DESTDIR):
[ -d $@ ] || $(MKDIR) $@
$(BSDINSTALL) $(INSTDIRFLAGS) $@
install: $(INSTALLED)

View File

@@ -32,6 +32,7 @@ H_FILES=
SRCS=$(C_FILES) $(CC_FILES) $(H_FILES)
OBJS=$(C_O_FILES) $(CC_O_FILES) $(S_O_FILES)
# FIXME: building into $(ARCH) doesn't make sense for host programs
PGMS=$(ARCH)/cklength$(EXEEXT) $(ARCH)/eolstrip$(EXEEXT) \
$(ARCH)/packhex$(EXEEXT) $(ARCH)/unhex$(EXEEXT)
@@ -60,5 +61,10 @@ LDFLAGS +=
CLEAN_ADDITIONS += $(HOST_ARCH)
CLOBBER_ADDITIONS +=
all: $(ARCH) $(SRCS) $(PGMS)
$(INSTALL) -m 555 $(PGMS) ${PROJECT_RELEASE}/build-tools
DESTDIR=${PROJECT_RELEASE}/build-tools
$(DESTDIR):
$(BSDINSTALL) $(INSTDIRFLAGS) $@
all: $(ARCH) $(DESTDIR) $(SRCS) $(PGMS)
$(BSDINSTALL) $(INSTBINFLAGS) $(PGMS) $(DESTDIR)

View File

@@ -22,13 +22,12 @@ PGMS=size_rtems
INSTALLED=$(PGMS:%=$(DESTDIR)/%)
all: $(DESTDIR) $(PGMS) install
echo $(DESTDIR)
$(DESTDIR):
[ -d $@ ] || $(MKDIR) $@
$(BSDINSTALL) $(INSTDIRFLAGS) $@
install: $(INSTALLED)
# Install the program
$(DESTDIR)/%: %
$(make-script)
$(BSDINSTALL) $(INSTBINFLAGS) $^ $@

View File

@@ -50,7 +50,7 @@ CLEAN_ADDITIONS +=
CLOBBER_ADDITIONS +=
all: ${ARCH} $(SRCS) preinstall $(PGMS)
$(INSTALL) -m 555 ${PGMS} ${PROJECT_RELEASE}/bin
$(INSTALL) $(INSTBINFLAGS) ${PGMS} ${PROJECT_RELEASE}/bin
# Hack
# we are #including files that haven't been installed yet.

View File

@@ -50,7 +50,7 @@ CLEAN_ADDITIONS +=
CLOBBER_ADDITIONS +=
all: ${ARCH} $(SRCS) $(PGMS)
$(INSTALL) -m 555 ${PGMS} ${PROJECT_RELEASE}/bin
$(BSDINSTALL) $(INSTBINFLAGS) ${PGMS} ${PROJECT_RELEASE}/bin
preinstall:

View File

@@ -30,13 +30,10 @@ CHMOD=@CHMOD@
SED=@SED@
M4=@M4@
BSDINSTALL=@INSTALL@
INSTALL=$(PROJECT_TOOLS)/install-if-change
INSTALL_VARIANT=$(PROJECT_TOOLS)/install-if-change -V "$(LIB_VARIANT)"
FGREP=@FGREP@
GREP=@GREP@
EGREP=@EGREP@
# FIXME: HACK for a bug in cygwin-hosted egcs which returns a mixture
# of '\\' and '/' as path separators.
# Should be removed as soon as this bug is fixed in egcs.
@@ -70,3 +67,9 @@ define make-script
-e '1,1s?^#!SHELL?#!$(SHELL)?' < $< > $@
$(CHMOD) 0555 $@
endef
INSTBINFLAGS = -m 0755
INSTDATAFLAGS = -m 0644
INSTLIBFLAGS = -m 0644
INSTDIRFLAGS = -m 0755 -d
INSTINCFLAGS = -m 0644

View File

@@ -24,15 +24,15 @@ INSTALL_LIST= $(PGMS) $(MISC_SUPPORT)
INSTALLED=$(INSTALL_LIST:%=$(DESTDIR)/%)
all: $(DESTDIR)
echo $(DESTDIR)
$(DESTDIR):
[ -d $@ ] || $(MKDIR) $@
$(BSDINSTALL) $(INSTDIRFLAGS) $@
install: $(INSTALLED)
# Install the program
# FIXME: This isn't correct
$(DESTDIR)/%: %
$(make-script)
$(INSTALL) -m 555 $(PERL_PGMS) ${DESTDIR}
$(INSTALL) -m 444 $(srcdir)/$(MISC_SUPPORT) ${DESTDIR}
$(BSDINSTALL) $(INSTBINFLAGS) $(PERL_PGMS) ${DESTDIR}
$(BSDINSTALL) $(INSTDATAFLAGS) $(MISC_SUPPORT) ${DESTDIR}

View File

@@ -94,6 +94,7 @@ AC_PATH_PROG(LN,ln)
AC_PROG_LN_S
AC_PATH_PROG(CHMOD,chmod)
AC_PATH_PROG(SORT,sort)
AC_PROG_INSTALL
dnl check mkdir behaviour, try to get mkdir -p -m 0755
RTEMS_PATH_MKDIR

View File

@@ -30,13 +30,10 @@ CHMOD=@CHMOD@
SED=@SED@
M4=@M4@
BSDINSTALL=@INSTALL@
INSTALL=$(PROJECT_TOOLS)/install-if-change
INSTALL_VARIANT=$(PROJECT_TOOLS)/install-if-change -V "$(LIB_VARIANT)"
FGREP=@FGREP@
GREP=@GREP@
EGREP=@EGREP@
# FIXME: HACK for a bug in cygwin-hosted egcs which returns a mixture
# of '\\' and '/' as path separators.
# Should be removed as soon as this bug is fixed in egcs.
@@ -70,3 +67,9 @@ define make-script
-e '1,1s?^#!SHELL?#!$(SHELL)?' < $< > $@
$(CHMOD) 0555 $@
endef
INSTBINFLAGS = -m 0755
INSTDATAFLAGS = -m 0644
INSTLIBFLAGS = -m 0644
INSTDIRFLAGS = -m 0755 -d
INSTINCFLAGS = -m 0644

View File

@@ -63,7 +63,7 @@ VARIANTS=${TARGET_ARCH} ${TARGET_VARIANTS:%=${TARGET_ARCH}-%}
# List of "recursion-able" targets for directory Makefiles
#
RECURSE_TARGETS=all clean protos get clobber depend \
RECURSE_TARGETS=all clean protos get clobber depend install \
$(TARGET_VARIANTS) $(TARGET_VARIANTS:%=%_install)
ifeq ($(RTEMS_USE_OWN_PDIR),yes)

View File

@@ -18,10 +18,9 @@ INSTALLED=$(DESTDIR)/ifc.exe \
$(DESTDIR)/fixtimer.exe
all: $(DESTDIR) $(PGMS) install
echo $(DESTDIR)
$(DESTDIR):
[ -d $@ ] || $(MKDIR) $@
$(BSDINSTALL) $(INSTDIRFLAGS) $@
install: $(INSTALLED)

View File

@@ -23,10 +23,9 @@ PGMS=install-if-change rcs-clean lock-directory unlock-directory \
INSTALLED=$(PGMS:%=$(DESTDIR)/%)
all: $(DESTDIR) $(PGMS) install
echo $(DESTDIR)
$(DESTDIR):
[ -d $@ ] || $(MKDIR) $@
$(BSDINSTALL) $(INSTDIRFLAGS) $@
install: $(INSTALLED)

View File

@@ -32,6 +32,7 @@ H_FILES=
SRCS=$(C_FILES) $(CC_FILES) $(H_FILES)
OBJS=$(C_O_FILES) $(CC_O_FILES) $(S_O_FILES)
# FIXME: building into $(ARCH) doesn't make sense for host programs
PGMS=$(ARCH)/cklength$(EXEEXT) $(ARCH)/eolstrip$(EXEEXT) \
$(ARCH)/packhex$(EXEEXT) $(ARCH)/unhex$(EXEEXT)
@@ -60,5 +61,10 @@ LDFLAGS +=
CLEAN_ADDITIONS += $(HOST_ARCH)
CLOBBER_ADDITIONS +=
all: $(ARCH) $(SRCS) $(PGMS)
$(INSTALL) -m 555 $(PGMS) ${PROJECT_RELEASE}/build-tools
DESTDIR=${PROJECT_RELEASE}/build-tools
$(DESTDIR):
$(BSDINSTALL) $(INSTDIRFLAGS) $@
all: $(ARCH) $(DESTDIR) $(SRCS) $(PGMS)
$(BSDINSTALL) $(INSTBINFLAGS) $(PGMS) $(DESTDIR)

View File

@@ -22,13 +22,12 @@ PGMS=size_rtems
INSTALLED=$(PGMS:%=$(DESTDIR)/%)
all: $(DESTDIR) $(PGMS) install
echo $(DESTDIR)
$(DESTDIR):
[ -d $@ ] || $(MKDIR) $@
$(BSDINSTALL) $(INSTDIRFLAGS) $@
install: $(INSTALLED)
# Install the program
$(DESTDIR)/%: %
$(make-script)
$(BSDINSTALL) $(INSTBINFLAGS) $^ $@

View File

@@ -50,7 +50,7 @@ CLEAN_ADDITIONS +=
CLOBBER_ADDITIONS +=
all: ${ARCH} $(SRCS) $(PGMS)
$(INSTALL) -m 555 ${PGMS} ${PROJECT_RELEASE}/bin
$(BSDINSTALL) $(INSTBINFLAGS) ${PGMS} ${PROJECT_RELEASE}/bin
preinstall:

View File

@@ -24,15 +24,15 @@ INSTALL_LIST= $(PGMS) $(MISC_SUPPORT)
INSTALLED=$(INSTALL_LIST:%=$(DESTDIR)/%)
all: $(DESTDIR)
echo $(DESTDIR)
$(DESTDIR):
[ -d $@ ] || $(MKDIR) $@
$(BSDINSTALL) $(INSTDIRFLAGS) $@
install: $(INSTALLED)
# Install the program
# FIXME: This isn't correct
$(DESTDIR)/%: %
$(make-script)
$(INSTALL) -m 555 $(PERL_PGMS) ${DESTDIR}
$(INSTALL) -m 444 $(srcdir)/$(MISC_SUPPORT) ${DESTDIR}
$(BSDINSTALL) $(INSTBINFLAGS) $(PERL_PGMS) ${DESTDIR}
$(BSDINSTALL) $(INSTDATAFLAGS) $(MISC_SUPPORT) ${DESTDIR}