Commit 32e5291f authored by sof's avatar sof
Browse files

[project @ 1997-03-23 22:34:44 by sof]

Debugged install rules
parent 0d90ab1c
...@@ -66,17 +66,12 @@ ifneq "$(DOC_SRCS)" "" ...@@ -66,17 +66,12 @@ ifneq "$(DOC_SRCS)" ""
$(MKDEPENDLIT) -o .depend $(MKDEPENDLIT_OPTS) $(filter %.lit,$(DOC_SRCS)) $(MKDEPENDLIT) -o .depend $(MKDEPENDLIT_OPTS) $(filter %.lit,$(DOC_SRCS))
endif endif
ifneq "$(MKDEPENDC_SRCS)" "" ifneq "$(MKDEPENDC_SRCS)" ""
$(MKDEPENDC) -f .depend $(MKDEPENDC_OPTS) \ $(MKDEPENDC) -f .depend $(MKDEPENDC_OPTS) -- $(CC_OPTS) -- $(MKDEPENDC_SRCS)
-- $(CC_OPTS) -- $(MKDEPENDC_SRCS)
endif endif
ifneq "$(MKDEPENDHS_SRCS)" "" ifneq "$(MKDEPENDHS_SRCS)" ""
ifeq ($(notdir $(MKDEPENDHS)),ghc) ifeq ($(notdir $(MKDEPENDHS)),ghc)
# New way of doing dependencies: the ghc driver knows how to invoke script # New way of doing dependencies: the ghc driver knows how to invoke script
$(MKDEPENDHS) -M -optdep-f -optdep.depend \ $(MKDEPENDHS) -M -optdep-f -optdep.depend $(foreach way,$(WAYS),-optdep-s -optdep$(way)) $(MKDEPENDHS_OPTS) $(HC_OPTS) $(MKDEPENDHS_SRCS)
$(foreach way,$(WAYS),-optdep-s -optdep$(way)) \
$(MKDEPENDHS_OPTS) \
$(HC_OPTS) \
$(MKDEPENDHS_SRCS)
else else
# Old way: call mkdependHS-1.2 # Old way: call mkdependHS-1.2
$(MKDEPENDHS) -f .depend $(MKDEPENDHS_OPTS) \ $(MKDEPENDHS) -f .depend $(MKDEPENDHS_OPTS) \
...@@ -382,8 +377,12 @@ $(SCRIPT_PROG) :: $(SCRIPT_OBJS) ...@@ -382,8 +377,12 @@ $(SCRIPT_PROG) :: $(SCRIPT_OBJS)
$(RM) $@ $(RM) $@
@echo Creating $@... @echo Creating $@...
ifeq "$(INTERP)" "perl" ifeq "$(INTERP)" "perl"
ifneq "$(BIN_DIST)" "1"
@echo "eval 'exec perl -S $$$""0 $$""{1+\"$$$""@\"}'" > $@ @echo "eval 'exec perl -S $$$""0 $$""{1+\"$$$""@\"}'" > $@
@echo " if $$""running_under_some_shell;" >> $@ @echo " if $$""running_under_some_shell;" >> $@
else
@touch $@
endif
else else
ifneq "$(INTERP)" "" ifneq "$(INTERP)" ""
@echo "#!"$(INTERP) > $@ @echo "#!"$(INTERP) > $@
...@@ -411,6 +410,7 @@ endif ...@@ -411,6 +410,7 @@ endif
# get one install rule # get one install rule
# #
# INSTALL_PROGS install these executable programs in $(bindir) # INSTALL_PROGS install these executable programs in $(bindir)
# INSTALL_SCRIPTS install these executable scripts in $(bindir)
# INSTALL_LIBS install these platform-dependent libraries in $(libdir) # INSTALL_LIBS install these platform-dependent libraries in $(libdir)
# INSTALL_LIBEXECS install these platform-dependent execs in $(libdir) # INSTALL_LIBEXECS install these platform-dependent execs in $(libdir)
# INSTALL_DATAS install these platform-independent files in $(datadir) # INSTALL_DATAS install these platform-independent files in $(datadir)
...@@ -429,17 +429,42 @@ endif ...@@ -429,17 +429,42 @@ endif
# from the installation itself. # from the installation itself.
# #
installdirs :: installdirs ::
$(INSTALL_DIR) $(bindir) @$(INSTALL_DIR) $(bindir)
$(INSTALL_DIR) $(libdir) @$(INSTALL_DIR) $(libdir)
$(INSTALL_DIR) $(libexecdir) @$(INSTALL_DIR) $(libexecdir)
$(INSTALL_DIR) $(datadir) @$(INSTALL_DIR) $(datadir)
# Better do this first... # Better do this first...
install:: installdirs install:: installdirs
ifneq "$(INSTALL_PROGS)" "" ifneq "$(INSTALL_PROGS)" ""
install:: $(INSTALL_PROGS) install:: $(INSTALL_PROGS)
$(INSTALL_PROGRAM) $(INSTALL_OPTS) $(INSTALL_PROGS) $(bindir) $(INSTALL_PROGRAM) $(INSTALL_BIN_OPTS) $(INSTALL_PROGS) $(bindir)
endif
ifneq "$(INSTALL_SCRIPTS)" ""
install:: $(INSTALL_SCRIPTS)
ifeq "$(INTERP)" "perl"
ifneq "$(BIN_DIST)" "1"
@for i in $(INSTALL_SCRIPTS); do \
$(RM) $$i.tmp; \
echo "eval 'exec $(PERL) -S $$$""0 $$""{1+\"$$$""@\"}'" > $$i.tmp ; \
echo " if $$""running_under_some_shell;" >> $$i.tmp ; \
echo $$"bindir='$(bindir);'" >> $$i.tmp ; \
echo $$"libdir='$(real_libdir)';" >> $$i.tmp ; \
echo $$"datadir='$(real_datadir)';" >> $$i.tmp ; \
cat $$i >> $$i.tmp ; \
echo $(INSTALL_PROGRAM) $(INSTALL_OPTS) $$i $(bindir) ; \
$(INSTALL_PROGRAM) $(INSTALL_OPTS) $$i.tmp $(bindir)/$$i ; \
$(RM) $$i.tmp; \
done
else
$(INSTALL_PROGRAM) $(INSTALL_OPTS) $(INSTALL_SCRIPTS) $(bindir)
endif
else
$(INSTALL_PROGRAM) $(INSTALL_OPTS) $(INSTALL_SCRIPTS) $(bindir)
endif
endif endif
ifneq "$(INSTALL_LIBS)" "" ifneq "$(INSTALL_LIBS)" ""
...@@ -449,7 +474,7 @@ endif ...@@ -449,7 +474,7 @@ endif
ifneq "$(INSTALL_LIBEXECS)" "" ifneq "$(INSTALL_LIBEXECS)" ""
install:: $(INSTALL_LIBEXECS) install:: $(INSTALL_LIBEXECS)
$(INSTALL_PROGRAM) $(INSTALL_OPTS) $(INSTALL_LIBEXECS) $(libexecdir) $(INSTALL_PROGRAM) $(INSTALL_BIN_OPTS) $(INSTALL_LIBEXECS) $(libexecdir)
endif endif
ifneq "$(INSTALL_DATAS)" "" ifneq "$(INSTALL_DATAS)" ""
...@@ -520,7 +545,7 @@ endif ...@@ -520,7 +545,7 @@ endif
# #
# does not expand the {}, it has to be a separate argument (i.e. `a {}'). # does not expand the {}, it has to be a separate argument (i.e. `a {}').
# GNU find is (IMHO) more sensible here, expanding any {} it comes across # GNU find is (IMHO) more sensible here, expanding any {} it comes across
# inside an -exec, whether it is a separate argument or part of a word: # inside an -exec, whether it is a separate arg or part of a word:
# #
# $ touch yes # $ touch yes
# $ find --version # $ find --version
...@@ -528,8 +553,8 @@ endif ...@@ -528,8 +553,8 @@ endif
# $ find yes -exec echo oh,{}! \; # $ find yes -exec echo oh,{}! \;
# oh,yes! # oh,yes!
# #
# I'm not claiming that the above is not possible to achieve with # Of course, the above is not impossible toi achieve with other finds,
# other finds, just that GNU find does the Patently Right Thing here :) # just that GNU find does the Patently Right Thing here :)
# #
# ====> if you're using these dist rules, get hold of GNU findutils. # ====> if you're using these dist rules, get hold of GNU findutils.
# #
...@@ -589,14 +614,26 @@ binary-dist-pre:: ...@@ -589,14 +614,26 @@ binary-dist-pre::
-rm -f $(BIN_DIST_TMPDIR)/$(BIN_DIST_NAME).tar.gz -rm -f $(BIN_DIST_TMPDIR)/$(BIN_DIST_NAME).tar.gz
@for i in $(BIN_DIST_DIRS); do \ @for i in $(BIN_DIST_DIRS); do \
if (test -d "$$i"); then \ if (test -d "$$i"); then \
echo $(MKDIRHIER) $(BIN_DIST_TMPDIR)/$(BIN_DIST_NAME)/bin/$(TARGETPLATFORM); \ echo $(MKDIRHIER) $(BIN_DIST_TMPDIR)/$(BIN_DIST_NAME)/bin/$(TARGETPLATFORM)/$$i-$(ProjectVersion); \
$(MKDIRHIER) $(BIN_DIST_TMPDIR)/$(BIN_DIST_NAME)/bin/$(TARGETPLATFORM); \ $(MKDIRHIER) $(BIN_DIST_TMPDIR)/$(BIN_DIST_NAME)/bin/$(TARGETPLATFORM)/$$i-$(ProjectVersion); \
echo $(MKDIRHIER) $(BIN_DIST_TMPDIR)/$(BIN_DIST_NAME)/lib/$(TARGETPLATFORM)/$$i-$(ProjectVersion); \ echo $(MKDIRHIER) $(BIN_DIST_TMPDIR)/$(BIN_DIST_NAME)/lib/$(TARGETPLATFORM)/$$i-$(ProjectVersion); \
$(MKDIRHIER) $(BIN_DIST_TMPDIR)/$(BIN_DIST_NAME)/lib/$(TARGETPLATFORM)/$$i-$(ProjectVersion); \ $(MKDIRHIER) $(BIN_DIST_TMPDIR)/$(BIN_DIST_NAME)/lib/$(TARGETPLATFORM)/$$i-$(ProjectVersion); \
echo $(MKDIRHIER) $(BIN_DIST_TMPDIR)/$(BIN_DIST_NAME)/share/$$i-$(ProjectVersion); \ echo $(MKDIRHIER) $(BIN_DIST_TMPDIR)/$(BIN_DIST_NAME)/share/$$i-$(ProjectVersion); \
$(MKDIRHIER) $(BIN_DIST_TMPDIR)/$(BIN_DIST_NAME)/share/$$i-$(ProjectVersion); \ $(MKDIRHIER) $(BIN_DIST_TMPDIR)/$(BIN_DIST_NAME)/share/$$i-$(ProjectVersion); \
echo $(MAKE) -C $$i $(MFLAGS) install BIN_DIST=1 BIN_DIST_NAME=$(BIN_DIST_NAME) prefix=$(BIN_DIST_TMPDIR)/$(BIN_DIST_NAME) exec_prefix=$(BIN_DIST_TMPDIR)/$(BIN_DIST_NAME) bindir=$(BIN_DIST_TMPDIR)/$(BIN_DIST_NAME)/bin/$(TARGETPLATFORM) libdir=$(BIN_DIST_TMPDIR)/$(BIN_DIST_NAME)/lib/$(TARGETPLATFORM)/$$i-$(ProjectVersion) libexecdir=$(BIN_DIST_TMPDIR)/$(BIN_DIST_NAME)/lib/$(TARGETPLATFORM)/$$i-$(ProjectVersion) datadir=$(BIN_DIST_TMPDIR)/$(BIN_DIST_NAME)/share/$$i-$(ProjectVersion); \ echo $(MAKE) -C $$i $(MFLAGS) install BIN_DIST=1 BIN_DIST_NAME=$(BIN_DIST_NAME) \
$(MAKE) -C $$i $(MFLAGS) install BIN_DIST=1 BIN_DIST_NAME=$(BIN_DIST_NAME) prefix=$(BIN_DIST_TMPDIR)/$(BIN_DIST_NAME) exec_prefix=$(BIN_DIST_TMPDIR)/$(BIN_DIST_NAME) bindir=$(BIN_DIST_TMPDIR)/$(BIN_DIST_NAME)/bin/$(TARGETPLATFORM) libdir=$(BIN_DIST_TMPDIR)/$(BIN_DIST_NAME)/lib/$(TARGETPLATFORM)/$$i-$(ProjectVersion) libexecdir=$(BIN_DIST_TMPDIR)/$(BIN_DIST_NAME)/lib/$(TARGETPLATFORM)/$$i-$(ProjectVersion) datadir=$(BIN_DIST_TMPDIR)/$(BIN_DIST_NAME)/share/$$i-$(ProjectVersion); \ prefix=$(BIN_DIST_TMPDIR)/$(BIN_DIST_NAME) \
exec_prefix=$(BIN_DIST_TMPDIR)/$(BIN_DIST_NAME) \
bindir=$(BIN_DIST_TMPDIR)/$(BIN_DIST_NAME)/bin/$(TARGETPLATFORM)/$$i-$(ProjectVersion) \
libdir=$(BIN_DIST_TMPDIR)/$(BIN_DIST_NAME)/lib/$(TARGETPLATFORM)/$$i-$(ProjectVersion) \
libexecdir=$(BIN_DIST_TMPDIR)/$(BIN_DIST_NAME)/lib/$(TARGETPLATFORM)/$$i-$(ProjectVersion) \
datadir=$(BIN_DIST_TMPDIR)/$(BIN_DIST_NAME)/share/$$i-$(ProjectVersion) ; \
$(MAKE) -C $$i $(MFLAGS) install BIN_DIST=1 BIN_DIST_NAME=$(BIN_DIST_NAME) \
prefix=$(BIN_DIST_TMPDIR)/$(BIN_DIST_NAME) \
exec_prefix=$(BIN_DIST_TMPDIR)/$(BIN_DIST_NAME) \
bindir=$(BIN_DIST_TMPDIR)/$(BIN_DIST_NAME)/bin/$(TARGETPLATFORM)/$$i-$(ProjectVersion) \
libdir=$(BIN_DIST_TMPDIR)/$(BIN_DIST_NAME)/lib/$(TARGETPLATFORM)/$$i-$(ProjectVersion) \
libexecdir=$(BIN_DIST_TMPDIR)/$(BIN_DIST_NAME)/lib/$(TARGETPLATFORM)/$$i-$(ProjectVersion) \
datadir=$(BIN_DIST_TMPDIR)/$(BIN_DIST_NAME)/share/$$i-$(ProjectVersion) ; \
fi; \ fi; \
done done
...@@ -606,6 +643,17 @@ binary-dist-pre:: ...@@ -606,6 +643,17 @@ binary-dist-pre::
binary-pack:: binary-pack::
( cd $(BIN_DIST_TMPDIR); $(TAR) chzf $(BIN_DIST_NAME).tar.gz $(BIN_DIST_NAME); rm -rf $(BIN_DIST_NAME) ) ( cd $(BIN_DIST_TMPDIR); $(TAR) chzf $(BIN_DIST_NAME).tar.gz $(BIN_DIST_NAME); rm -rf $(BIN_DIST_NAME) )
ifneq "$(way)" ""
package-way-dist::
( cd $(BIN_DIST_TMPDIR); find $(BIN_DIST_NAME)/ \( -name "*$(_way).a" -o -name "*.$(way_)hi" \) -print | xargs tar cvf $(BIN_DIST_TMPDIR)/ghc-$(ProjectVersion)-$(way)-$(TARGETPLATFORM).tar )
gzip $(BIN_DIST_TMPDIR)/ghc-$(ProjectVersion)-$(way)-$(TARGETPLATFORM).tar
endif
ifneq "$(way)" ""
remove-way-dist::
( cd $(BIN_DIST_TMPDIR); find $(BIN_DIST_NAME)/ \( -name "*$(_way).a" -o -name "*.$(way_)hi" \) -print -exec rm -f {} \; )
endif
########################################### ###########################################
# #
# Targets: check tags show info # Targets: check tags show info
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment