Makefile 6.34 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
# $Xorg: Makefile,v 1.5 2000/08/17 19:41:44 cpqbld Exp $
# $Id: Makefile,v 1.5 2005/12/14 23:41:52 alanc Exp $



# $XFree86: xc/Makefile,v 3.28tsi Exp $

# Luna users will need to either run make as "make MAKE=make"
# or add "MAKE = make" to this file.

RELEASE = "Release 6.9"
SHELL = /bin/sh
RM = rm -f
MV = mv
WORLDOPTS =
WIN32WORLDOPTS = -i
TOP = .
CURRENT_DIR = .
CONFIGSRC = $(TOP)/config
IMAKESRC = $(CONFIGSRC)/imake
DEPENDSRC = $(CONFIGSRC)/makedepend
DEPENDTOP = ../..
IMAKETOP = ../..
IRULESRC = $(CONFIGSRC)/cf
IMAKE = $(IMAKESRC)/imake
IMAKE_CMD = $(IMAKE) -I$(IRULESRC) $(IMAKE_DEFINES)
MAKE_OPTS = -f xmakefile
MAKE_CMD = $(MAKE) $(MAKE_OPTS)
FLAGS = $(MFLAGS) -f Makefile.ini BOOTSTRAPCFLAGS="$(BOOTSTRAPCFLAGS)" CC="$(CC)"
VERSINC = -Iprograms/Xserver/hw/xfree86
VERSSRC = $(CONFIGSRC)/util/printver.c
VERSPROG = $(CONFIGSRC)/util/printver.exe

all:
Mike Gabriel's avatar
Mike Gabriel committed
35 36
	@$(MAKE_CMD) xmakefile-exists || $(MAKE) all-initial
	@$(MAKE_CMD) $@
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59

all-initial:
	@echo Please use make World, or on NT use nmake World.Win32.
	@echo Check the configuration parameters in the $(IRULESRC) directory,
	@echo and pass BOOTSTRAPCFLAGS if necessary.
	@echo Read the release notes carefully before proceeding.
	@echo Do not name your log file make.log or it will be deleted.

World:
	@-$(RM) $(VERSPROG)
	@-$(CC) $(VERSINC) -o $(VERSPROG) $(VERSSRC)
	@echo ""
	@echo Building $(RELEASE).
	@echo ""
	@-$(RM) $(VERSPROG)
	@case "x$(BOOTSTRAPCFLAGS)" in x) \
	echo I hope you checked the configuration parameters in $(IRULESRC) ; \
	echo to see if you need to pass BOOTSTRAPCFLAGS. ; \
	echo "" ; \
	;; esac;
	@date
	@echo ""
	@if [ -f xmakefile ]; then \
Mike Gabriel's avatar
Mike Gabriel committed
60 61
	    $(MAKE_CMD) -k distclean || \
	    $(MAKE_CMD) -k clean || \
62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86
	    $(RM) xmakefile; \
	fi
	@if [ ! -f $(IRULESRC)/host.def ]; then \
	    if [ ! -f $(TOP)/lib/Xt/Imakefile ]; then \
		echo "#define BuildServersOnly YES" > $(IRULESRC)/host.def; \
	    else \
		if [ ! -f $(TOP)/fonts/Imakefile ]; then \
		    echo "#define BuildFonts NO" > $(IRULESRC)/host.def; \
		else \
		    echo "" > $(IRULESRC)/host.def; \
		fi; \
	    fi; \
	fi
#	@rm -f $(IRULESRC)/version.def; echo "" > $(IRULESRC)/version.def;
	@rm -f $(IRULESRC)/date.def; echo "" > $(IRULESRC)/date.def;
#	@if [ ! -f $(IRULESRC)/version.def ]; then \
#	    rm -f $(IRULESRC)/version.def; \
#	    echo "" > $(IRULESRC)/version.def; \
#	fi
#	@if [ ! -f $(IRULESRC)/date.def ]; then \
#	    rm -f $(IRULESRC)/date.def; \
#	    echo "" > $(IRULESRC)/date.def; \
#	fi
	cd $(IMAKESRC) && $(MAKE) $(FLAGS) clean
	$(MAKE) $(MFLAGS) Makefile.boot
Mike Gabriel's avatar
Mike Gabriel committed
87
	$(MAKE_CMD) $(MFLAGS) version.def
88
	$(MAKE) $(MFLAGS) Makefile.boot
Mike Gabriel's avatar
Mike Gabriel committed
89 90 91 92 93 94
	$(MAKE_CMD) $(MFLAGS) VerifyOS
	$(MAKE_CMD) $(MFLAGS) Makefiles
	$(MAKE_CMD) $(MFLAGS) BOOTSTRAPSUBDIRS= clean
	$(MAKE_CMD) $(MFLAGS) includes
	$(MAKE_CMD) $(MFLAGS) depend
	$(MAKE_CMD) $(MFLAGS) $(WORLDOPTS) World
95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155
	@echo ""
	@date
	@echo ""
	@-$(RM) $(VERSPROG)
	@-$(CC) $(VERSINC) -o $(VERSPROG) $(VERSSRC)
	@echo Full build of $(RELEASE) complete.
	@-$(RM) $(VERSPROG)
	@echo ""

.PRECIOUS: Makefile

# This is just a sequence of bootstrapping steps we have to do.
# The steps are listed as separate targets so clearmake can wink in
# the Makefile.proto files.

Makefile.boot: imake.bootstrap
	$(RM) $(IMAKESRC)/Makefile.proto

imake.proto:
	cd $(IMAKESRC) && $(MAKE) $(FLAGS)
	$(RM) $(DEPENDSRC)/Makefile.proto

$(DEPENDSRC)/Makefile.proto: imake.proto
	$(IMAKE_CMD) -s $(DEPENDSRC)/Makefile.proto -f $(DEPENDSRC)/Imakefile -DTOPDIR=$(DEPENDTOP) -DCURDIR=$(DEPENDSRC)

depend.bootstrap: $(DEPENDSRC)/Makefile.proto
	cd $(DEPENDSRC) && $(RM) -r Makefile Makefile.dep makedepend *.o bootstrap
	cd $(DEPENDSRC) && $(MAKE) -f Makefile.proto bootstrap

$(IMAKESRC)/Makefile.proto: depend.bootstrap
	$(IMAKE_CMD) -s $(IMAKESRC)/Makefile.proto -f $(IMAKESRC)/Imakefile -DTOPDIR=$(IMAKETOP) -DCURDIR=$(IMAKESRC) -DBootStrap

imake.bootstrap: $(IMAKESRC)/Makefile.proto
	cd $(IMAKESRC) && $(MAKE) -f Makefile.proto bootstrapdepend
	cd $(IMAKESRC) && $(MAKE) $(FLAGS) bootstrap
	cd $(IMAKESRC) && $(MAKE) -f Makefile.proto imakeonly
	-@if [ -f xmakefile ]; then set -x; \
	  $(RM) xmakefile.bak; $(MV) xmakefile xmakefile.bak; \
	  else exit 0; fi
	$(MAKE) $(MFLAGS) xmakefile

Makefile::
	$(MAKE) $(MFLAGS) xmakefile

xmakefile: Imakefile
	$(RM) xmakefile
	$(IMAKE_CMD) -s xmakefile -DTOPDIR=$(TOP) -DCURDIR=$(CURRENT_DIR)

World.Win32:
	@echo :
	@echo Building $(RELEASE).
	@echo :
	@echo :
	-@if not exist $(IRULESRC)\host.def echo > $(IRULESRC)\host.def
	cd $(IMAKESRC)
	$(MAKE) -f Makefile.ini clean.Win32
	$(MAKE) -f Makefile.ini imake.exe
	cd ..\..
	-if exist xmakefile.bak del xmakefile.bak
	-if exist xmakefile ren xmakefile xmakefile.bak
	$(IMAKE:/=\) -s xmakefile -I$(IRULESRC) $(IMAKE_DEFINES) -DTOPDIR=$(TOP) -DCURDIR=$(CURRENT_DIR)
Mike Gabriel's avatar
Mike Gabriel committed
156 157 158
	$(MAKE_CMD) $(MFLAGS) VerifyOS
	$(MAKE_CMD) $(MFLAGS) Makefiles
	$(MAKE_CMD) $(MFLAGS) clean
159 160 161
	cd $(CONFIGSRC)\util
	$(MAKE) mkdirhier.exe
	cd ..\..
Mike Gabriel's avatar
Mike Gabriel committed
162 163 164
	$(MAKE_CMD) $(MFLAGS) includes
	$(MAKE_CMD) $(MFLAGS) depend
	$(MAKE_CMD) $(MFLAGS) $(WIN32WORLDOPTS)
165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199
	@echo :
	@echo :
	@echo Full build of $(RELEASE) complete.
	@echo :

World.OS2:
	@echo :
	@echo Building $(RELEASE) on OS/2.
	@echo :
	@echo :
	-@if not exist $(IRULESRC)\host.def echo > $(IRULESRC)\host.def
	\indir $(IMAKESRC) $(MAKE) SHELL= -f Makefile.ini clean.os2
	\indir $(IMAKESRC) $(MAKE) SHELL= CC=gcc -f Makefile.ini imake.os2
	-if exist Makefile.bak del Makefile.bak
	-if exist Makefile ren Makefile Makefile.bak
	$(subst /,\,$(IMAKE)) -I$(IRULESRC) $(IMAKE_DEFINES) -DTOPDIR=$(TOP) -DCURDIR=$(CURRENT_DIR)
	$(MAKE) $(MFLAGS) VerifyOS
	$(MAKE) $(MFLAGS) Makefiles
	$(MAKE) $(MFLAGS) clean
	$(MAKE) $(MFLAGS) includes
	$(MAKE) $(MFLAGS) depend
	$(MAKE) $(MFLAGS)
	@echo :
	@echo :
	@echo Full build of $(RELEASE) on OS/2 complete.
	@echo :

# don't allow any default rules in this Makefile
.SUFFIXES:
# quiet "make" programs that display a message if suffix list empty
.SUFFIXES: .Dummy

# a copy of every rule that might be invoked at top level

clean:
Mike Gabriel's avatar
Mike Gabriel committed
200
	    $(MAKE_CMD) $@
201
dangerous_strip_clean:
Mike Gabriel's avatar
Mike Gabriel committed
202
	    $(MAKE_CMD) $@
203
distclean:
Mike Gabriel's avatar
Mike Gabriel committed
204
	    $(MAKE_CMD) $@
205 206
	    $(RM) xmakefile $(IRULESRC)/version.def $(IRULESRC)/date.def
depend:
Mike Gabriel's avatar
Mike Gabriel committed
207
	    $(MAKE_CMD) $@
208
Everything:
Mike Gabriel's avatar
Mike Gabriel committed
209
	    $(MAKE_CMD) $@
210
external.ln:
Mike Gabriel's avatar
Mike Gabriel committed
211
	    $(MAKE_CMD) $@
212
includes:
Mike Gabriel's avatar
Mike Gabriel committed
213
	    $(MAKE_CMD) $@
214
install.sdk:
Mike Gabriel's avatar
Mike Gabriel committed
215
	    $(MAKE_CMD) $@
216
install.ln:
Mike Gabriel's avatar
Mike Gabriel committed
217
	    $(MAKE_CMD) $@
218
install.man:
Mike Gabriel's avatar
Mike Gabriel committed
219
	    $(MAKE_CMD) $@
220
install:
Mike Gabriel's avatar
Mike Gabriel committed
221
	    $(MAKE_CMD) $@
222
Makefiles:
Mike Gabriel's avatar
Mike Gabriel committed
223
	    $(MAKE_CMD) $@
224
man_keywords:
Mike Gabriel's avatar
Mike Gabriel committed
225
	    $(MAKE_CMD) $@
226
tags:
Mike Gabriel's avatar
Mike Gabriel committed
227
	    $(MAKE_CMD) $@
228
VerifyOS:
Mike Gabriel's avatar
Mike Gabriel committed
229
	    $(MAKE_CMD) $@