1992-07-11 05:24:19 +08:00
|
|
|
###
|
|
|
|
### Makefile used to three-stage build a tree of source code. Also used to
|
|
|
|
### compile other bundles, first with cc, then with gcc.
|
|
|
|
###
|
|
|
|
|
1992-11-23 09:40:05 +08:00
|
|
|
###
|
|
|
|
### USE OF THIS FILE REQUIRES GNU MAKE!!!
|
|
|
|
###
|
|
|
|
|
|
|
|
### The first versions of the file were written by Rich Pixley (rich@cygnus.com).
|
|
|
|
### Many subsequent additions (and current maintainance by) david d `zoo' zuhn,
|
|
|
|
### (zoo@cygnus.com).
|
1992-07-11 05:24:19 +08:00
|
|
|
|
|
|
|
### Every invocation of this Makefile needs to have a variable set (host),
|
|
|
|
### which is the named used for ./configure, and also the prefix for the
|
|
|
|
### various files and directories used in a three stage.
|
|
|
|
|
|
|
|
ifndef host
|
1992-11-23 09:40:05 +08:00
|
|
|
error:
|
|
|
|
@echo You must set the variable \"host\" to use this Makefile ; exit 1
|
1992-07-11 05:24:19 +08:00
|
|
|
else
|
|
|
|
|
|
|
|
### from here to very near the end of the file is the real guts of this
|
|
|
|
### Makefile, and it is not seen if the variable 'host' is not set
|
|
|
|
|
|
|
|
###
|
|
|
|
### START EDITTING HERE!!!
|
|
|
|
### These things will need to be set differently for each release.
|
|
|
|
###
|
|
|
|
|
|
|
|
### from which cvs tree are we working?
|
1992-07-11 05:29:16 +08:00
|
|
|
TREE := devo
|
1992-07-11 05:24:19 +08:00
|
|
|
|
|
|
|
### binaries should be installed into?
|
|
|
|
ROOTING := /usr/cygnus
|
|
|
|
|
|
|
|
### When working from a tagged set of source, this should be the tag. If not,
|
|
|
|
### then set the macro to be empty.
|
1992-11-23 09:40:05 +08:00
|
|
|
CVS_TAG :=
|
1992-07-11 05:24:19 +08:00
|
|
|
|
|
|
|
### The name of the cvs module for this release. The intersection of
|
|
|
|
### CVS_MODULE and CVS_TAG defines the source files in this release.
|
1992-11-23 09:40:05 +08:00
|
|
|
CVS_MODULE := latest
|
1992-07-11 05:24:19 +08:00
|
|
|
|
|
|
|
### Historically, this was identical to CVS_TAG. This is changing.
|
1993-02-03 11:01:41 +08:00
|
|
|
RELEASE_TAG := latest-930202
|
1992-07-11 05:24:19 +08:00
|
|
|
|
|
|
|
### Historically, binaries were installed here. This is changing.
|
|
|
|
release_root := $(ROOTING)/$(RELEASE_TAG)
|
|
|
|
|
|
|
|
### STOP EDITTING HERE!!!
|
|
|
|
### With luck, eventually, nothing else will need to be editted.
|
|
|
|
|
1992-11-23 09:40:05 +08:00
|
|
|
TIME := time
|
|
|
|
GCC := gcc -O -g
|
|
|
|
GNUC := "CC=$(GCC)"
|
|
|
|
CFLAGS := -g
|
|
|
|
GNU_MAKE := /usr/latest/bin/make -w
|
1992-07-11 05:24:19 +08:00
|
|
|
|
1992-11-23 09:40:05 +08:00
|
|
|
override MAKE := make
|
|
|
|
override MFLAGS :=
|
|
|
|
#override MAKEFLAGS :=
|
1992-07-11 05:24:19 +08:00
|
|
|
|
1992-11-23 09:40:05 +08:00
|
|
|
SHELL := /bin/sh
|
1992-07-11 05:24:19 +08:00
|
|
|
|
|
|
|
FLAGS_TO_PASS := \
|
1993-01-29 07:11:07 +08:00
|
|
|
"CC=$(CC)" \
|
1992-07-11 05:24:19 +08:00
|
|
|
"GCC=$(GCC)" \
|
1992-11-23 09:40:05 +08:00
|
|
|
"CFLAGS=$(CFLAGS)" \
|
1992-07-11 05:24:19 +08:00
|
|
|
"TIME=$(TIME)" \
|
1992-11-23 09:40:05 +08:00
|
|
|
"MF=$(MF)" \
|
|
|
|
"host=$(host)"
|
|
|
|
|
|
|
|
|
1993-01-29 07:11:07 +08:00
|
|
|
prefixes = --prefix=$(release_root) --exec_prefix=$(release_root)/H-$(host)
|
1992-11-23 09:40:05 +08:00
|
|
|
relbindir = $(release_root)/H-$(host)/bin
|
|
|
|
|
1992-07-11 05:24:19 +08:00
|
|
|
|
|
|
|
### general config stuff
|
1992-11-23 09:40:05 +08:00
|
|
|
WORKING_DIR := $(host)-objdir
|
|
|
|
STAGE1DIR := $(WORKING_DIR).1
|
|
|
|
STAGE2DIR := $(WORKING_DIR).2
|
|
|
|
STAGE3DIR := $(WORKING_DIR).3
|
|
|
|
INPLACEDIR := $(host)-in-place
|
|
|
|
HOLESDIR := $(host)-holes
|
1992-07-11 05:24:19 +08:00
|
|
|
|
1993-01-29 07:11:07 +08:00
|
|
|
SET_HOLES := SHELL=sh ; PATH=`pwd`/$(HOLESDIR) ; export PATH ; export SHELL ;
|
|
|
|
SET_CYGNUS_PATH := SHELL=sh ; PATH=$(relbindir):`pwd`/$(HOLESDIR) ; export PATH ; export SHELL ;
|
|
|
|
SET_LATEST_PATH := SHELL=sh ; PATH=/usr/latest/bin:`pwd`/$(HOLESDIR) ; export PATH ; export SHELL ;
|
|
|
|
|
|
|
|
|
|
|
|
|
1992-07-11 05:24:19 +08:00
|
|
|
.PHONY: all
|
1992-11-23 09:40:05 +08:00
|
|
|
ifdef target
|
|
|
|
##
|
|
|
|
## This is a cross compilation
|
|
|
|
##
|
|
|
|
arch = $(host)-x-$(target)
|
|
|
|
config = $(host) -target=$(target)
|
|
|
|
NATIVEDIR := $(arch)-native-objdir
|
|
|
|
CYGNUSDIR := $(arch)-cygnus-objdir
|
|
|
|
LATESTDIR := $(arch)-latest-objdir
|
|
|
|
FLAGS_TO_PASS := $(FLAGS_TO_PASS) "target=$(target)"
|
|
|
|
|
|
|
|
all: do-native do-latest
|
|
|
|
build-all: build-native build-latest
|
|
|
|
|
|
|
|
else
|
|
|
|
##
|
|
|
|
## This is a native compilation
|
|
|
|
##
|
|
|
|
all: $(host)-stamp-3stage-done
|
|
|
|
#all: in-place do1 do2 do3 comparison
|
|
|
|
endif
|
|
|
|
|
|
|
|
everything: do-cross
|
|
|
|
#everything: in-place do1 do2 do3 comparison do-cygnus
|
|
|
|
|
|
|
|
.PHONY: do-native
|
|
|
|
do-native: $(host)-stamp-holes $(arch)-stamp-native
|
|
|
|
do-native-config: $(arch)-stamp-native-configured
|
|
|
|
build-native: $(host)-stamp-holes $(arch)-stamp-native-checked
|
|
|
|
config-native: $(host)-stamp-holes $(arch)-stamp-native-configured
|
|
|
|
|
1993-01-29 07:11:07 +08:00
|
|
|
$(arch)-stamp-native: $(host)-stamp-holes
|
|
|
|
$(SET_HOLES) $(TIME) $(GNU_MAKE) -f test-build.mk $(arch)-stamp-native-installed $(FLAGS_TO_PASS)
|
1992-11-23 09:40:05 +08:00
|
|
|
if [ -f CLEAN_ALL ] ; then rm -rf $(NATIVEDIR) ; else true ; fi
|
|
|
|
touch $(arch)-stamp-native
|
|
|
|
|
1993-01-29 07:11:07 +08:00
|
|
|
$(arch)-stamp-native-installed: $(host)-stamp-holes $(arch)-stamp-native-checked
|
|
|
|
$(SET_HOLES) cd $(NATIVEDIR) ; $(TIME) $(MAKE) $(FLAGS_TO_PASS) install
|
|
|
|
$(SET_HOLES) cd $(NATIVEDIR) ; $(TIME) $(MAKE) $(FLAGS_TO_PASS) install-info
|
1992-11-23 09:40:05 +08:00
|
|
|
touch $@
|
|
|
|
|
|
|
|
$(arch)-stamp-native-checked: $(arch)-stamp-native-built
|
|
|
|
# cd $(NATIVEDIR) ; $(TIME) $(MAKE) $(FLAGS_TO_PASS) check
|
|
|
|
touch $@
|
|
|
|
|
1993-01-29 07:11:07 +08:00
|
|
|
$(arch)-stamp-native-built: $(host)-stamp-holes $(arch)-stamp-native-configured
|
|
|
|
$(SET_HOLES) cd $(NATIVEDIR) ; $(TIME) $(MAKE) $(FLAGS_TO_PASS) all
|
|
|
|
$(SET_HOLES) cd $(NATIVEDIR) ; $(TIME) $(MAKE) $(FLAGS_TO_PASS) info
|
1992-11-23 09:40:05 +08:00
|
|
|
touch $@
|
|
|
|
|
1993-01-29 07:11:07 +08:00
|
|
|
$(arch)-stamp-native-configured: $(host)-stamp-holes
|
1992-11-23 09:40:05 +08:00
|
|
|
[ -d $(NATIVEDIR) ] || mkdir $(NATIVEDIR)
|
1993-01-29 07:11:07 +08:00
|
|
|
$(SET_HOLES) cd $(NATIVEDIR) ; $(TIME) ../$(TREE)/configure $(config) -v --srcdir=../$(TREE) $(prefixes)
|
1992-11-23 09:40:05 +08:00
|
|
|
touch $@
|
|
|
|
|
|
|
|
|
|
|
|
.PHONY: do-cygnus
|
|
|
|
do-cygnus: $(host)-stamp-holes $(arch)-stamp-cygnus
|
|
|
|
build-cygnus: $(host)-stamp-holes $(arch)-stamp-cygnus-checked
|
|
|
|
config-cygnus: $(host)-stamp-holes $(arch)-stamp-cygnus-configured
|
|
|
|
|
|
|
|
$(arch)-stamp-cygnus:
|
|
|
|
[ -f $(relbindir)/gcc ] || (echo "must have gcc available"; exit 1)
|
1993-01-29 07:11:07 +08:00
|
|
|
$(SET_CYGNUS_PATH) $(TIME) $(GNU_MAKE) -f test-build.mk $(arch)-stamp-cygnus-installed $(FLAGS_TO_PASS)
|
1992-11-23 09:40:05 +08:00
|
|
|
if [ -f CLEAN_ALL ] ; then rm -rf $(CYGNUSDIR) ; else true ; fi
|
|
|
|
touch $(arch)-stamp-cygnus
|
|
|
|
|
1993-01-29 07:11:07 +08:00
|
|
|
$(arch)-stamp-cygnus-installed: $(host)-stamp-holes $(arch)-stamp-cygnus-checked
|
|
|
|
$(SET_CYGNUS_PATH) cd $(CYGNUSDIR) ; $(TIME) $(MAKE) $(FLAGS_TO_PASS) $(GNUC) install
|
|
|
|
$(SET_CYGNUS_PATH) cd $(CYGNUSDIR) ; $(TIME) $(MAKE) $(FLAGS_TO_PASS) $(GNUC) install-info
|
1992-11-23 09:40:05 +08:00
|
|
|
touch $@
|
|
|
|
|
1993-01-29 07:11:07 +08:00
|
|
|
$(arch)-stamp-cygnus-checked: $(host)-stamp-holes $(arch)-stamp-cygnus-built
|
1992-11-23 09:40:05 +08:00
|
|
|
# cd $(CYGNUSDIR) ; $(TIME) $(MAKE) $(FLAGS_TO_PASS) $(GNUC) check
|
|
|
|
touch $@
|
|
|
|
|
1993-01-29 07:11:07 +08:00
|
|
|
$(arch)-stamp-cygnus-built: $(host)-stamp-holes $(arch)-stamp-cygnus-configured
|
|
|
|
$(SET_CYGNUS_PATH) cd $(CYGNUSDIR) ; $(TIME) $(MAKE) $(FLAGS_TO_PASS) $(GNUC) all
|
|
|
|
$(SET_CYGNUS_PATH) cd $(CYGNUSDIR) ; $(TIME) $(MAKE) $(FLAGS_TO_PASS) $(GNUC) info
|
1992-11-23 09:40:05 +08:00
|
|
|
touch $@
|
|
|
|
|
1993-01-29 07:11:07 +08:00
|
|
|
$(arch)-stamp-cygnus-configured: $(host)-stamp-holes
|
1992-11-23 09:40:05 +08:00
|
|
|
[ -d $(CYGNUSDIR) ] || mkdir $(CYGNUSDIR)
|
1993-01-29 07:11:07 +08:00
|
|
|
$(SET_CYGNUS_PATH) cd $(CYGNUSDIR) ; $(TIME) ../$(TREE)/configure $(config) -v --srcdir=../$(TREE) $(prefixes)
|
1992-11-23 09:40:05 +08:00
|
|
|
touch $@
|
|
|
|
|
|
|
|
.PHONY: do-latest
|
|
|
|
do-latest: $(host)-stamp-holes $(arch)-stamp-latest
|
|
|
|
build-latest: $(host)-stamp-holes $(arch)-stamp-latest-checked
|
|
|
|
|
|
|
|
$(arch)-stamp-latest:
|
1993-01-29 07:11:07 +08:00
|
|
|
$(SET_LATEST_PATH) $(TIME) $(GNU_MAKE) -f test-build.mk $(arch)-stamp-latest-installed $(FLAGS_TO_PASS)
|
1992-11-23 09:40:05 +08:00
|
|
|
touch $(arch)-stamp-latest
|
|
|
|
|
|
|
|
$(arch)-stamp-latest-installed: $(arch)-stamp-latest-checked
|
1993-01-29 07:11:07 +08:00
|
|
|
$(SET_LATEST_PATH) cd $(LATESTDIR) ; $(TIME) $(MAKE) $(FLAGS_TO_PASS) $(GNUC) install
|
|
|
|
$(SET_LATEST_PATH) cd $(LATESTDIR) ; $(TIME) $(MAKE) $(FLAGS_TO_PASS) $(GNUC) install-info
|
1992-11-23 09:40:05 +08:00
|
|
|
touch $@
|
|
|
|
|
|
|
|
$(arch)-stamp-latest-checked: $(arch)-stamp-latest-built
|
1993-01-29 07:11:07 +08:00
|
|
|
# $(SET_LATEST_PATH) cd $(LATESTDIR) ; $(TIME) $(MAKE) $(FLAGS_TO_PASS) $(GNUC) check
|
1992-11-23 09:40:05 +08:00
|
|
|
touch $@
|
|
|
|
|
|
|
|
$(arch)-stamp-latest-built: $(arch)-stamp-latest-configured
|
1993-01-29 07:11:07 +08:00
|
|
|
$(SET_LATEST_PATH) cd $(LATESTDIR) ; $(TIME) $(MAKE) $(FLAGS_TO_PASS) $(GNUC) all
|
|
|
|
$(SET_LATEST_PATH) cd $(LATESTDIR) ; $(TIME) $(MAKE) $(FLAGS_TO_PASS) $(GNUC) info
|
1992-11-23 09:40:05 +08:00
|
|
|
touch $@
|
|
|
|
|
|
|
|
$(arch)-stamp-latest-configured:
|
|
|
|
[ -d $(LATESTDIR) ] || mkdir $(LATESTDIR)
|
1993-01-29 07:11:07 +08:00
|
|
|
$(SET_LATEST_PATH) cd $(LATESTDIR) ; \
|
|
|
|
$(TIME) ../$(TREE)/configure $(config) -v --srcdir=../$(TREE) $(prefixes)
|
1992-11-23 09:40:05 +08:00
|
|
|
touch $@
|
|
|
|
|
1992-07-11 06:56:50 +08:00
|
|
|
|
|
|
|
.PHONY: in-place
|
|
|
|
in-place: $(host)-stamp-in-place
|
|
|
|
|
1992-11-23 09:40:05 +08:00
|
|
|
$(host)-stamp-in-place:
|
1992-07-11 06:56:50 +08:00
|
|
|
PATH=/bin:/usr/bin:/usr/ucb ; \
|
1992-11-23 09:40:05 +08:00
|
|
|
export PATH ; \
|
|
|
|
SHELL=/bin/sh ; export SHELL ; \
|
|
|
|
$(TIME) $(GNU_MAKE) -f test-build.mk $(host)-stamp-in-place-installed host=$(host) $(FLAGS_TO_PASS)
|
1992-07-11 06:56:50 +08:00
|
|
|
touch $@
|
1992-11-23 09:40:05 +08:00
|
|
|
if [ -f CLEAN_ALL ] ; then \
|
|
|
|
rm -rf $(INPLACEDIR) ; \
|
|
|
|
else \
|
|
|
|
mv $(INPLACEDIR) $(STAGE1DIR) ; \
|
|
|
|
fi
|
1992-07-11 06:56:50 +08:00
|
|
|
|
|
|
|
$(host)-stamp-in-place-installed: $(host)-stamp-in-place-checked
|
1993-01-29 07:11:07 +08:00
|
|
|
cd $(INPLACEDIR) ; $(TIME) $(MAKE) $(FLAGS_TO_PASS) "CFLAGS=$(CFLAGS)" install host=$(host)
|
|
|
|
cd $(INPLACEDIR) ; $(TIME) $(MAKE) $(FLAGS_TO_PASS) "CFLAGS=$(CFLAGS)" install-info host=$(host)
|
1992-07-11 06:56:50 +08:00
|
|
|
touch $@
|
|
|
|
|
|
|
|
$(host)-stamp-in-place-checked: $(host)-stamp-in-place-built
|
1993-01-29 07:11:07 +08:00
|
|
|
# cd $(INPLACEDIR) ; $(TIME) $(MAKE) $(FLAGS_TO_PASS) "CFLAGS=$(CFLAGS)" check host=$(host)
|
1992-07-11 06:56:50 +08:00
|
|
|
touch $@
|
|
|
|
|
|
|
|
$(host)-stamp-in-place-built: $(host)-stamp-in-place-configured
|
1993-01-29 07:11:07 +08:00
|
|
|
cd $(INPLACEDIR) ; $(TIME) $(MAKE) $(FLAGS_TO_PASS) "CFLAGS=$(CFLAGS)" all host=$(host)
|
|
|
|
cd $(INPLACEDIR) ; $(TIME) $(MAKE) $(FLAGS_TO_PASS) "CFLAGS=$(CFLAGS)" info host=$(host)
|
1992-07-11 06:56:50 +08:00
|
|
|
touch $@
|
|
|
|
|
|
|
|
$(host)-stamp-in-place-configured: $(host)-stamp-in-place-cp
|
1992-11-23 09:40:05 +08:00
|
|
|
cd $(INPLACEDIR) ; $(TIME) ./configure $(host) -v $(prefixes)
|
1992-07-11 06:56:50 +08:00
|
|
|
touch $@
|
|
|
|
|
|
|
|
$(host)-stamp-in-place-cp:
|
|
|
|
rm -rf $(INPLACEDIR)
|
|
|
|
mkdir $(INPLACEDIR)
|
|
|
|
(cd $(TREE) ; tar cf - .) | (cd $(INPLACEDIR) ; tar xf -)
|
|
|
|
touch $@
|
1992-07-11 05:24:19 +08:00
|
|
|
|
1992-11-23 09:40:05 +08:00
|
|
|
$(host)-stamp-3stage-done: do1 do2 do3 comparison
|
|
|
|
touch $@
|
|
|
|
|
|
|
|
|
1992-07-11 05:24:19 +08:00
|
|
|
.PHONY: do1
|
1993-01-29 07:11:07 +08:00
|
|
|
do1: $(host)-stamp-holes $(host)-stamp-stage1
|
|
|
|
do1-config: $(host)-stamp-holes $(host)-stamp-stage1-configured
|
|
|
|
do1-build: $(host)-stamp-holes $(host)-stamp-stage1-checked
|
1992-07-11 05:24:19 +08:00
|
|
|
|
|
|
|
$(host)-stamp-stage1:
|
|
|
|
if [ -d $(STAGE1DIR) ] ; then \
|
|
|
|
mv $(STAGE1DIR) $(WORKING_DIR) ; \
|
|
|
|
else \
|
|
|
|
true ; \
|
|
|
|
fi
|
1993-01-29 07:11:07 +08:00
|
|
|
$(SET_HOLES) $(TIME) $(GNU_MAKE) -f test-build.mk $(FLAGS_TO_PASS) host=$(host) $(host)-stamp-stage1-installed
|
1992-07-11 06:56:50 +08:00
|
|
|
touch $@
|
1992-11-23 09:40:05 +08:00
|
|
|
if [ -f CLEAN_ALL ] ; then \
|
|
|
|
rm -rf $(WORKING_DIR) ; \
|
|
|
|
else \
|
|
|
|
mv $(WORKING_DIR) $(STAGE1DIR) ; \
|
|
|
|
fi
|
1992-07-11 05:24:19 +08:00
|
|
|
|
|
|
|
$(host)-stamp-stage1-installed: $(host)-stamp-stage1-checked
|
1993-01-29 07:11:07 +08:00
|
|
|
$(SET_HOLES) cd $(WORKING_DIR) ; $(TIME) $(MAKE) $(FLAGS_TO_PASS) "CFLAGS=$(CFLAGS)" install host=$(host)
|
|
|
|
$(SET_HOLES) cd $(WORKING_DIR) ; $(TIME) $(MAKE) $(FLAGS_TO_PASS) "CFLAGS=$(CFLAGS)" install-info host=$(host)
|
1992-12-23 07:08:06 +08:00
|
|
|
ifeq ($(host),rs6000-ibm-aix)
|
|
|
|
rm $(relbindir)/make
|
|
|
|
endif
|
1992-07-11 05:24:19 +08:00
|
|
|
touch $@
|
|
|
|
|
|
|
|
$(host)-stamp-stage1-checked: $(host)-stamp-stage1-built
|
1993-01-29 07:11:07 +08:00
|
|
|
# $(SET_HOLES) cd $(WORKING_DIR) ; $(TIME) $(MAKE) $(FLAGS_TO_PASS) "CFLAGS=$(CFLAGS)" check host=$(host)
|
1992-07-11 05:24:19 +08:00
|
|
|
touch $@
|
|
|
|
|
|
|
|
$(host)-stamp-stage1-built: $(host)-stamp-stage1-configured
|
1993-01-29 07:11:07 +08:00
|
|
|
$(SET_HOLES) cd $(WORKING_DIR) ; $(TIME) $(MAKE) $(FLAGS_TO_PASS) "CFLAGS=$(CFLAGS)" all host=$(host)
|
|
|
|
$(SET_HOLES) cd $(WORKING_DIR) ; $(TIME) $(MAKE) $(FLAGS_TO_PASS) "CFLAGS=$(CFLAGS)" info host=$(host)
|
1992-07-11 05:24:19 +08:00
|
|
|
touch $@
|
|
|
|
|
|
|
|
$(host)-stamp-stage1-configured:
|
|
|
|
[ -d $(WORKING_DIR) ] || mkdir $(WORKING_DIR)
|
1993-01-29 07:11:07 +08:00
|
|
|
$(SET_HOLES) cd $(WORKING_DIR) ; \
|
|
|
|
$(TIME) ../$(TREE)/configure $(host) -v --srcdir=../$(TREE) $(prefixes)
|
1992-07-11 05:24:19 +08:00
|
|
|
touch $@
|
|
|
|
|
|
|
|
.PHONY: do2
|
|
|
|
do2: $(HOLESDIR) $(host)-stamp-stage2
|
|
|
|
|
|
|
|
$(host)-stamp-stage2:
|
|
|
|
if [ -d $(STAGE2DIR) ] ; then \
|
|
|
|
mv $(STAGE2DIR) $(WORKING_DIR) ; \
|
|
|
|
else \
|
|
|
|
true ; \
|
|
|
|
fi
|
1993-01-29 07:11:07 +08:00
|
|
|
$(SET_CYGNUS_PATH) $(TIME) $(GNU_MAKE) $(FLAGS_TO_PASS) -f test-build.mk -w $(host)-stamp-stage2-installed
|
1992-11-23 09:40:05 +08:00
|
|
|
mv $(WORKING_DIR) $(STAGE2DIR)
|
1992-07-11 06:56:50 +08:00
|
|
|
touch $@
|
1992-07-11 05:24:19 +08:00
|
|
|
|
|
|
|
|
|
|
|
$(host)-stamp-stage2-installed: $(host)-stamp-stage2-checked
|
1993-01-29 07:11:07 +08:00
|
|
|
$(SET_CYGNUS_PATH) cd $(WORKING_DIR) ; $(TIME) $(MAKE) -w $(FLAGS_TO_PASS) $(GNUC) "CFLAGS=$(CFLAGS)" install host=$(host)
|
|
|
|
$(SET_CYGNUS_PATH) cd $(WORKING_DIR) ; $(TIME) $(MAKE) -w $(FLAGS_TO_PASS) $(GNUC) "CFLAGS=$(CFLAGS)" install-info host=$(host)
|
1992-07-11 05:24:19 +08:00
|
|
|
touch $@
|
|
|
|
|
|
|
|
$(host)-stamp-stage2-checked: $(host)-stamp-stage2-built
|
1993-01-29 07:11:07 +08:00
|
|
|
# $(SET_CYGNUS_PATH) cd $(WORKING_DIR) ; $(TIME) $(MAKE) -w $(FLAGS_TO_PASS) $(GNUC) "CFLAGS=$(CFLAGS)" check host=$(host)
|
1992-07-11 05:24:19 +08:00
|
|
|
touch $@
|
|
|
|
|
|
|
|
$(host)-stamp-stage2-built: $(host)-stamp-stage2-configured
|
1993-01-29 07:11:07 +08:00
|
|
|
$(SET_CYGNUS_PATH) cd $(WORKING_DIR) ; $(TIME) $(MAKE) -w $(FLAGS_TO_PASS) $(GNUC) "CFLAGS=$(CFLAGS)" all host=$(host)
|
|
|
|
$(SET_CYGNUS_PATH) cd $(WORKING_DIR) ; $(TIME) $(MAKE) -w $(FLAGS_TO_PASS) $(GNUC) "CFLAGS=$(CFLAGS)" info host=$(host)
|
1992-07-11 05:24:19 +08:00
|
|
|
touch $@
|
|
|
|
|
|
|
|
$(host)-stamp-stage2-configured:
|
|
|
|
[ -d $(WORKING_DIR) ] || mkdir $(WORKING_DIR)
|
1993-01-29 07:11:07 +08:00
|
|
|
$(SET_CYGNUS_PATH) cd $(WORKING_DIR) ; \
|
|
|
|
$(TIME) ../$(TREE)/configure $(host) -v --srcdir=../$(TREE) $(prefixes)
|
1992-07-11 05:24:19 +08:00
|
|
|
touch $@
|
|
|
|
|
|
|
|
.PHONY: do3
|
|
|
|
do3: $(HOLESDIR) $(host)-stamp-stage3
|
|
|
|
|
|
|
|
$(host)-stamp-stage3:
|
1992-11-23 09:40:05 +08:00
|
|
|
if [ -d $(STAGE3DIR) ] ; then \
|
|
|
|
mv $(STAGE3DIR) $(WORKING_DIR) ; \
|
1992-07-11 05:24:19 +08:00
|
|
|
else \
|
|
|
|
true ; \
|
|
|
|
fi
|
1993-01-29 07:11:07 +08:00
|
|
|
$(SET_CYGNUS_PATH) $(TIME) $(GNU_MAKE) $(FLAGS_TO_PASS) -f test-build.mk -w $(host)-stamp-stage3-checked
|
1992-11-23 09:40:05 +08:00
|
|
|
mv $(WORKING_DIR) $(STAGE3DIR)
|
1992-07-11 06:56:50 +08:00
|
|
|
touch $@
|
1992-07-11 05:24:19 +08:00
|
|
|
|
|
|
|
|
|
|
|
$(host)-stamp-stage3-installed: $(host)-stamp-stage3-checked
|
1993-01-29 07:11:07 +08:00
|
|
|
$(SET_CYGNUS_PATH) cd $(WORKING_DIR) ; $(TIME) $(MAKE) -w $(FLAGS_TO_PASS) $(GNUC) "CFLAGS=$(CFLAGS)" install host=$(host)
|
|
|
|
$(SET_CYGNUS_PATH) cd $(WORKING_DIR) ; $(TIME) $(MAKE) -w $(FLAGS_TO_PASS) $(GNUC) "CFLAGS=$(CFLAGS)" install-info host=$(host)
|
1992-07-11 05:24:19 +08:00
|
|
|
touch $@
|
|
|
|
|
|
|
|
$(host)-stamp-stage3-checked: $(host)-stamp-stage3-built
|
1993-01-29 07:11:07 +08:00
|
|
|
# $(SET_CYGNUS_PATH) cd $(WORKING_DIR) ; $(TIME) $(MAKE) -w $(FLAGS_TO_PASS) $(GNUC) "CFLAGS=$(CFLAGS)" check host=$(host)
|
1992-07-11 05:24:19 +08:00
|
|
|
touch $@
|
|
|
|
|
|
|
|
$(host)-stamp-stage3-built: $(host)-stamp-stage3-configured
|
1993-01-29 07:11:07 +08:00
|
|
|
$(SET_CYGNUS_PATH) cd $(WORKING_DIR) ; $(TIME) $(MAKE) -w $(FLAGS_TO_PASS) $(GNUC) "CFLAGS=$(CFLAGS)" all host=$(host)
|
|
|
|
$(SET_CYGNUS_PATH) cd $(WORKING_DIR) ; $(TIME) $(MAKE) -w $(FLAGS_TO_PASS) $(GNUC) "CFLAGS=$(CFLAGS)" info host=$(host)
|
1992-07-11 05:24:19 +08:00
|
|
|
touch $@
|
|
|
|
|
|
|
|
$(host)-stamp-stage3-configured:
|
|
|
|
[ -d $(WORKING_DIR) ] || mkdir $(WORKING_DIR)
|
1993-01-29 07:11:07 +08:00
|
|
|
$(SET_CYGNUS_PATH) cd $(WORKING_DIR) ; \
|
|
|
|
$(TIME) ../$(TREE)/configure $(host) -v --srcdir=../$(TREE) $(prefixes)
|
1992-07-11 05:24:19 +08:00
|
|
|
touch $@
|
|
|
|
|
|
|
|
# These things are needed by a three-stage, but are not included locally.
|
|
|
|
|
|
|
|
HOLES := \
|
|
|
|
[ \
|
|
|
|
ar \
|
|
|
|
as \
|
|
|
|
awk \
|
|
|
|
basename \
|
|
|
|
cat \
|
|
|
|
cc \
|
|
|
|
chmod \
|
|
|
|
cmp \
|
|
|
|
cp \
|
1993-01-29 07:11:07 +08:00
|
|
|
cpio \
|
1992-07-11 05:24:19 +08:00
|
|
|
date \
|
|
|
|
diff \
|
|
|
|
echo \
|
|
|
|
egrep \
|
|
|
|
ex \
|
|
|
|
expr \
|
|
|
|
find \
|
|
|
|
grep \
|
1992-11-23 09:40:05 +08:00
|
|
|
head \
|
1992-07-11 05:24:19 +08:00
|
|
|
hostname \
|
|
|
|
install \
|
|
|
|
ld \
|
|
|
|
lex \
|
|
|
|
ln \
|
|
|
|
ls \
|
|
|
|
make \
|
|
|
|
mkdir \
|
|
|
|
mv \
|
|
|
|
nm \
|
|
|
|
pwd \
|
|
|
|
ranlib \
|
|
|
|
rm \
|
|
|
|
rmdir \
|
|
|
|
sed \
|
|
|
|
sh \
|
|
|
|
sort \
|
1993-01-29 07:11:07 +08:00
|
|
|
tar \
|
1992-07-11 05:24:19 +08:00
|
|
|
test \
|
|
|
|
time \
|
|
|
|
touch \
|
|
|
|
tr \
|
|
|
|
true \
|
1993-01-29 07:11:07 +08:00
|
|
|
uudecode \
|
1992-07-18 07:26:35 +08:00
|
|
|
wc \
|
1992-07-11 05:24:19 +08:00
|
|
|
whoami
|
|
|
|
|
|
|
|
### so far only sun make supports VPATH
|
|
|
|
ifeq ($(subst sun3,sun4,$(host)),sun4)
|
|
|
|
MAKE_HOLE :=
|
|
|
|
else
|
|
|
|
MAKE_HOLE := make
|
|
|
|
endif
|
|
|
|
|
1992-11-23 09:40:05 +08:00
|
|
|
### solaris 2 -- don't use /usr/ucb/cc
|
|
|
|
ifeq (sparc-sun-solaris2,$(host))
|
1993-02-03 11:01:41 +08:00
|
|
|
SET_HOLES := SHELL=sh ; PATH=/opt/SUNWspro/bin:`pwd`/$(HOLESDIR) ; export PATH ; export SHELL ;
|
|
|
|
HOLE_DIRS := /usr/ccs/bin
|
|
|
|
PARTIAL_HOLE_DIRS := /opt/SUNWspro/bin
|
|
|
|
CC_HOLE :=
|
1992-11-23 09:40:05 +08:00
|
|
|
endif
|
|
|
|
|
1992-07-11 05:24:19 +08:00
|
|
|
### rs6000 as is busted. We cache a patched version in unsupported.
|
1992-11-23 09:40:05 +08:00
|
|
|
ifeq ($(host),rs6000-ibm-aix)
|
1992-07-11 05:24:19 +08:00
|
|
|
AS_HOLE := as
|
|
|
|
else
|
|
|
|
AS_HOLE :=
|
|
|
|
endif
|
|
|
|
|
|
|
|
### These things are also needed by a three-stage, but in this case, the GNU version of the tool is required.
|
|
|
|
PARTIAL_HOLES := \
|
|
|
|
$(AS_HOLE) \
|
|
|
|
$(MAKE_HOLE) \
|
1992-11-23 09:40:05 +08:00
|
|
|
$(CC_HOLE) \
|
1992-07-11 05:24:19 +08:00
|
|
|
flex \
|
|
|
|
m4
|
|
|
|
|
|
|
|
### look in these directories for things missing from a three-stage
|
|
|
|
HOLE_DIRS := \
|
1992-12-23 07:08:06 +08:00
|
|
|
$(HOLE_DIRS) \
|
1992-07-11 05:24:19 +08:00
|
|
|
/bin \
|
|
|
|
/usr/bin \
|
|
|
|
/usr/ucb \
|
|
|
|
/usr/unsupported/bin
|
|
|
|
|
|
|
|
### look in these directories for alternate versions of some tools.
|
|
|
|
PARTIAL_HOLE_DIRS := \
|
|
|
|
/usr/latest/bin \
|
|
|
|
/usr/progressive/bin \
|
1992-12-23 07:08:06 +08:00
|
|
|
$(PARTIAL_HOLE_DIRS) \
|
1992-07-11 05:24:19 +08:00
|
|
|
/usr/vintage/bin \
|
|
|
|
/usr/unsupported/bin
|
|
|
|
|
|
|
|
$(HOLESDIR): $(host)-stamp-holes
|
|
|
|
|
|
|
|
$(host)-stamp-holes:
|
|
|
|
-rm -rf $(HOLESDIR)
|
|
|
|
-mkdir $(HOLESDIR)
|
1992-11-23 09:40:05 +08:00
|
|
|
@for i in $(HOLES) ; do \
|
1992-07-11 05:24:19 +08:00
|
|
|
found= ; \
|
|
|
|
for j in $(HOLE_DIRS) ; do \
|
|
|
|
if [ -x $$j/$$i ] ; then \
|
1992-12-30 07:10:26 +08:00
|
|
|
ln -s $$j/$$i $(HOLESDIR) || cp $$j/$$i $(HOLESDIR) ; \
|
1992-07-11 05:24:19 +08:00
|
|
|
echo $$i from $$j ; \
|
|
|
|
found=t ; \
|
|
|
|
break ; \
|
|
|
|
fi ; \
|
|
|
|
done ; \
|
|
|
|
case "$$found" in \
|
|
|
|
t) ;; \
|
|
|
|
*) echo $$i is NOT found ;; \
|
|
|
|
esac ; \
|
|
|
|
done
|
1992-11-23 09:40:05 +08:00
|
|
|
@for i in $(PARTIAL_HOLES) ; do \
|
1992-07-11 05:24:19 +08:00
|
|
|
found= ; \
|
|
|
|
for j in $(PARTIAL_HOLE_DIRS) ; do \
|
|
|
|
if [ -x $$j/$$i ] ; then \
|
|
|
|
rm -f $(HOLESDIR)/$$i ; \
|
|
|
|
cp $$j/$$i $(HOLESDIR)/$$i || exit 1; \
|
|
|
|
echo $$i from $$j ; \
|
|
|
|
found=t ; \
|
|
|
|
break ; \
|
|
|
|
fi ; \
|
|
|
|
done ; \
|
|
|
|
case "$$found" in \
|
|
|
|
t) ;; \
|
|
|
|
*) echo $$i is NOT found ;; \
|
|
|
|
esac ; \
|
|
|
|
done
|
1992-07-11 06:56:50 +08:00
|
|
|
touch $@
|
1992-07-11 05:24:19 +08:00
|
|
|
|
|
|
|
.PHONY: comparison
|
1992-11-23 09:40:05 +08:00
|
|
|
comparison: $(host)-stamp-3stage-compared
|
|
|
|
|
|
|
|
$(host)-stamp-3stage-compared:
|
|
|
|
rm -f .bad-compare
|
1992-12-30 07:10:26 +08:00
|
|
|
ifeq ($(subst i386-sco3.2v4,mips-sgi-irix4,$(subst rs6000-ibm-aix,mips-sgi-irix4,$(subst mips-dec-ultrix,mips-sgi-irix4,$(host)))),mips-sgi-irix4)
|
1992-11-23 09:40:05 +08:00
|
|
|
for i in `cd $(STAGE3DIR) ; find . -name \*.o -print` ; do \
|
|
|
|
tail +10c $(STAGE2DIR)/$$i > foo1 ; \
|
|
|
|
tail +10c $(STAGE3DIR)/$$i > foo2 ; \
|
|
|
|
if cmp foo1 foo2 ; then \
|
|
|
|
true ; \
|
|
|
|
else \
|
|
|
|
echo $$i ; \
|
|
|
|
touch .bad-compare ; \
|
|
|
|
fi ; \
|
|
|
|
done
|
|
|
|
rm -f foo1 foo2
|
1992-07-11 05:24:19 +08:00
|
|
|
else
|
1992-11-23 09:40:05 +08:00
|
|
|
for i in `cd $(STAGE3DIR) ; find . -name \*.o -print` ; do \
|
|
|
|
cmp $(STAGE2DIR)/$$i $(STAGE3DIR)/$$i || touch .bad-compare ; \
|
|
|
|
done
|
|
|
|
endif
|
|
|
|
if [ -f CLEAN_ALL ] ; then \
|
|
|
|
rm -rf $(STAGE2DIR) $(STAGE3DIR) ; \
|
1992-07-18 13:56:28 +08:00
|
|
|
else \
|
1992-11-23 09:40:05 +08:00
|
|
|
if [ -f CLEAN_STAGES ] ; then \
|
|
|
|
if [ -f .bad-compare ] ; then \
|
|
|
|
true ; \
|
|
|
|
else \
|
|
|
|
rm -rf $(STAGE1DIR) $(STAGE2DIR) ; \
|
|
|
|
fi ; \
|
1992-12-30 07:10:26 +08:00
|
|
|
else true ; \
|
1992-11-23 09:40:05 +08:00
|
|
|
fi ; \
|
1992-07-18 13:56:28 +08:00
|
|
|
fi
|
1992-11-23 09:40:05 +08:00
|
|
|
touch $@
|
1992-07-11 05:24:19 +08:00
|
|
|
|
|
|
|
.PHONY: clean
|
|
|
|
clean:
|
1992-07-11 06:56:50 +08:00
|
|
|
rm -rf $(HOLESDIR) $(INPLACEDIR) $(WORKING_DIR)* $(host)-stamp-* *~
|
1992-07-11 05:24:19 +08:00
|
|
|
|
|
|
|
.PHONY: very
|
|
|
|
very:
|
1992-07-11 06:56:50 +08:00
|
|
|
rm -rf $(TREE)
|
1992-07-11 05:24:19 +08:00
|
|
|
|
|
|
|
force:
|
|
|
|
|
|
|
|
endif # host
|
|
|
|
|
|
|
|
### Local Variables:
|
|
|
|
### fill-column: 131
|
|
|
|
### End:
|