📄 makevars.mk
字号:
## Copyright (C) 1998, 1999, Jonathan S. Shapiro.## This file is part of the EROS Operating System.## This program is free software; you can redistribute it and/or# modify it under the terms of the GNU General Public License# as published by the Free Software Foundation; either version 2,# or (at your option) any later version.## This program is distributed in the hope that it will be useful,# but WITHOUT ANY WARRANTY; without even the implied warranty of# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the# GNU General Public License for more details.## You should have received a copy of the GNU General Public License# along with this program; if not, write to the Free Software# Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.## Cancel the old suffix list, because the order matters. We want assembly # source to be recognized in preference to ordinary source code, so the# .S, .s cases must come ahead of the rest..SUFFIXES:.SUFFIXES: .S .s .cxx .c .y .l .o .dvi .ltx .gif .fig .xml .html .pdf## Set up default values for these variables so that a build in an improperly# configured environment has a fighting chance:#ifndef EROS_TARGETEROS_TARGET=i486endififndef EROS_ROOTEROS_ROOT=$(HOME)/erosendififndef EROS_XENVEROS_XENV=$(HOME)/eros-xenvendififndef EROS_CONFIGEROS_CONFIG=DEFAULTexport EROS_CONFIGendif# Some shells do not export this variable, and it is used in the package# generation rule below.ifeq "$(PWD)" ""PWD=$(shell pwd)endifexport EROS_ROOTexport EROS_TARGETexport EROS_XENVexport EROS_CONFIGINSTALL=$(EROS_SRC)/build/lib/make/erosinstallREPLACE=$(EROS_SRC)/build/lib/make/move-if-change## First, set up variables for building native tools:#GAWK=gawkPYTHON=pythonXML_LINT=$(EROS_XENV)/bin/xmllintXSLT=$(EROS_XENV)/bin/xsltprocNATIVE_STRIP=stripNATIVE_OBJDUMP=objdumpNATIVE_SIZE=sizeNATIVE_AR=arNATIVE_LD=ldNATIVE_RANLIB=ranlibNATIVE_GCC=gccifndef GCCWARNGCCWARN=-Wall -Winline -Werror -Wno-formatendifNATIVE_GPLUS=g++ifndef GPLUSWARNGPLUSWARN=-Wall -Winline -Werror -Wno-formatendif## Then variables for building EROS binaries:#EROS_GCC=$(NATIVE_GCC)EROS_GPLUS=$(NATIVE_GPLUS)EROS_LD=$(NATIVE_LD)EROS_AR=$(NATIVE_AR)EROS_RANLIB=$(NATIVE_RANLIB)EROS_OBJDUMP=$(NATIVE_OBJDUMP)EROS_STRIP=$(NATIVE_STRIP)EROS_SIZE=$(NATIVE_SIZE)## Then variables related to installation and test generation:#HOST_FD=/dev/fd0H1440 ################################################################# DANGER, WILL ROBINSON!!!!## The EROS_HD environment variable is defined to something# harmless here **intentionally**. There are too many ways# to do grievous injuries to a misconfigured host environment# by setting a default.## It is intended that the intrepid UNIX-based developer should# pick a hard disk partition, set that up with lilo or some# such, make it mode 666 from their UNIX environment, and# then set EROS_HD to name that partition device file. This# is how *I* work, but you do this at your own risk!!################################################################ifndef EROS_HDEROS_HD=/dev/nullendif## This is where the target environment makefile gets a chance to override# things:#ifndef EROS_HOSTENVEROS_HOSTENV=linux-xenvendifinclude $(EROS_SRC)/build/lib/make/$(EROS_HOSTENV).mk# search for ppmtogif in all the obvious places:ifndef NETPBMDIRifneq "" "$(findstring /usr/bin/ppmtogif,$(wildcard /usr/bin/*))"NETPBMDIR=/usr/binendifendififndef NETPBMDIRifneq "" "$(findstring /usr/bin/X11/ppmtogif,$(wildcard /usr/bin/X11/*))"NETPBMDIR=/usr/bin/X11endifendififndef NETPBMDIRifneq "" "$(findstring /usr/local/netpbm/ppmtogif,$(wildcard /usr/local/netpbm/*))"NETPBMDIR=/usr/local/netpbmendifendififndef EROS_FDEROS_FD=$(HOST_FD)endif## Now for the REALLY SLEAZY part: if this makefile is performing a# cross build, smash the native tool variables with the cross tool # variables. The clean thing to do would be to separate the rules # somehow, but this is quicker:ifdef CROSS_BUILDGCC=$(EROS_GCC)GPLUS=$(EROS_GPLUS)LD=$(EROS_LD)AR=$(EROS_AR)OBJDUMP=$(EROS_OBJDUMP)SIZE=$(EROS_SIZE)STRIP=$(EROS_STRIP)RANLIB=$(EROS_RANLIB)GPLUS_OPTIM=$(EROS_GPLUS_OPTIM)endififndef CROSS_BUILDGCC=$(NATIVE_GCC)GPLUS=$(NATIVE_GPLUS)LD=$(NATIVE_LD)AR=$(NATIVE_AR)OBJDUMP=$(NATIVE_OBJDUMP)SIZE=$(NATIVE_SIZE)STRIP=$(NATIVE_STRIP)RANLIB=$(NATIVE_RANLIB)GPLUS_OPTIM=$(NATIVE_GPLUS_OPTIM)endif## in all the places where this is run, we actually want the environmental# definitions set for the target environment.#EROS_CPP=$(EROS_GCC) -x c++ -E -undef -nostdinc -D$(EROS_TARGET)DOMCRT0=$(EROS_ROOT)/lib/crt0.oRUNCRT0=RUNCRT0_OBSOLETEDOMLINKOPT=-N -Ttext 0x0 -nostdlib -static -e _start -L$(EROS_ROOT)/lib -L$(EROS_ROOT)/lib/$(EROS_TARGET)DOMLINK=$(EROS_LD)DOMLIB= $(EROS_ROOT)/lib/libdomc.aDOMLIB += $(EROS_ROOT)/lib/libdomain.aDOMLIB += $(EROS_ROOT)/lib/libdomgcc.aDOMLIB += $(EROS_ROOT)/lib/crtn.o# Really ugly GNU Makeism to extract the name of the current package by# stripping $EROS_ROOT/ out of $PWD (yields: src/PKG/xxxxxx), turning /# characters into spaces (yields: "src PKG xxx xxx xxx"), and # then selecting the appropriate word. Notice that the first substring is # empty, so the appropriate word is the second one.PACKAGE=$(word 1, $(strip $(subst /, ,$(subst $(EROS_ROOT)/src/,,$(PWD)))))# Until proven otherwise...IMGMAP=imgmap# Until proven otherwise...BOOTSTRAP=bootifeq "$(BUILDDIR)" ""ifeq "$(PACKAGE)" "doc"BUILDDIR=.endififeq "$(PACKAGE)" "legal"BUILDDIR=.endififeq "$(PACKAGE)" "build"BUILDDIR=.endififeq "$(BUILDDIR)" ""BUILDDIR=BUILD/$(EROS_TARGET)endifendif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -