📄 makerules.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.#unexport DIRSunexport ETAGDIRSunexport GENERATEDunexport CLEANLISTifndef GCCWARNinclude $(EROS_SRC)/build/lib/make/makevars.mkendif# The following variables depend on things set in the makefile:GCCFLAGS=$(CFLAGS) $(OPTIM) $(INC) $(DEF)GPLUSFLAGS=-fdefault-inline -fno-implicit-templates $(OPTIM) $(GPLUS_OPTIM) $(INC) $(DEF)ifndef CLEANDIRSCLEANDIRS=$(DIRS)endifDEP_SEDHACK=sed 's,^[^:]*:[:]*,'$@' '$(BUILDDIR)/'&,g'C_DEP=@$(GCC) $(GCCFLAGS) $(GCCWARN) -E -M $< | $(DEP_SEDHACK) > $@CXX_DEP=@$(GPLUS) $(GPLUSFLAGS) $(GPLUSWARN) -E -M $< | $(DEP_SEDHACK) > $@ASM_DEP=@$(GPLUS) $(GCCFLAGS) -E -M $< | $(DEP_SEDHACK) > $@C_BUILD=$(GCC) $(GCCFLAGS) $(GCCWARN) -c $< -o $@CXX_BUILD=$(GPLUS) $(GPLUSFLAGS) $(GPLUSWARN) -c $< -o $@ASM_BUILD=$(GPLUS) $(GCCFLAGS) -c $< -o $@ifeq "$(BUILDDIR)" ""$(error BUILDDIR is not set!)endififneq "$(BUILDDIR)" "."CLEAN_BUILDDIR=$(BUILDDIR)endif$(BUILDDIR)/.%.m: %.S $(ASM_DEP) #$(GPLUS) $(GCCFLAGS) -E -M $< | $(DEP_SEDHACK) > $@$(BUILDDIR)/.%.m: %.s @echo "Please rewrite .s file as .S file"$(BUILDDIR)/.%.m: %.c $(C_DEP) # $(GCC) $(GCCFLAGS) -E -M $< | $(DEP_SEDHACK) > $@$(BUILDDIR)/.%.m: %.cxx $(CXX_DEP) #$(GPLUS) $(GPLUSFLAGS) $(GPLUSWARN) -E -M $< | $(DEP_SEDHACK) > $@## Object construction rules#$(BUILDDIR)/%.o: %.S $(ASM_BUILD) @#$(GPLUS) $(GCCFLAGS) -c $< -o $@$(BUILDDIR)/%.o: %.c $(C_BUILD) @#$(GCC) $(GCCFLAGS) $(GCCWARN) -o $@ -c $<$(BUILDDIR)/%.o: %.cxx $(CXX_BUILD) @#$(GPLUS) $(GPLUSFLAGS) $(GPLUSWARN) -o $@ -c $<# Rules to process XML files to produce HTML:%.html: %.xml $(XSLT) -xinclude --param docname \"$*\" -o $@ $(EROS_SRC)/doc/www/DTD/html-doc.xslt $<$(BUILDDIR)/%.html: %.xml $(XSLT) -xinclude --param docname \"$*\" -o $@ $(EROS_SRC)/doc/www/DTD/html-doc.xslt $<.%.xml.m: %.xml @echo "$(<:.xml=.html): $< $(EROS_SRC)/doc/www/DTD/html-doc.xslt" > $@$(BUILDDIR)/.%.xml.m: %.xml @echo "$(<:.xml=.html): $< $(EROS_SRC)/doc/www/DTD/html-doc.xslt" > $@%.dvi: %.ltx latex $< latex $<%.gif: %.fig @if [ \! -x $(NETPBMDIR)/ppmtogif ]; then\ echo "ERROR: Please set the NETPBMDIR environment variable to identify"; \ echo " the location of the NetPBM directory."; \ exit 1;\ fi fig2dev -L ppm $< $*.ppm $(NETPBMDIR)/ppmtogif -t '#ffffff' $*.ppm > $@ -rm -f $*.ppm.PHONEY : depend nodepend recursive-depend all recursive-all install recursive-install clobber walk clean do-clean recursive-clean world packageworld: $(MAKE) -C $(EROS_SRC) $(MAKERULES) installifneq "$(PACKAGE)" ""package: $(MAKE) -C $(EROS_ROOT)/src/$(PACKAGE) $(MAKERULES) installendifshowpackage: @echo $(PACKAGE)depend: recursive-depend DEPENDrecursive-depend:ifneq "$(DIRS)" "" @for i in $(DIRS); do \ if [ -d "$$i" ]; then\ $(MAKE) -C $$i $(MAKERULES) depend; \ if [ $$? -ne 0 ]; then\ echo "*** RECURSIVE BUILD STOPS ***";\ exit 1;\ fi; \ fi; \ doneendifall: recursive-allrecursive-all:ifneq "$(DIRS)" "" @for i in $(DIRS); do \ if [ -d "$$i" ]; then\ $(MAKE) -C $$i $(MAKERULES) all; \ if [ $$? -ne 0 ]; then\ echo "*** RECURSIVE BUILD STOPS ***";\ exit 1;\ fi; \ fi; \ doneendifinstall: recursive-installrecursive-install:ifneq "$(DIRS)" "" @for i in $(DIRS); do \ if [ -d "$$i" ]; then\ $(MAKE) -C $$i $(MAKERULES) install; \ if [ $$? -ne 0 ]; then\ echo "*** RECURSIVE BUILD STOPS ***";\ exit 1;\ fi; \ fi; \ doneendif$(BUILDDIR): mkdir -p $(BUILDDIR)# The following hack fixes up directory dependencies, and ALSO ensures# that the .m files will be rebuilt when appropriate:DEPEND: $(BUILDDIR)#DEPEND: $(patsubst %.o,$(BUILDDIR)/%.m,$(OBJECTS)) DEPEND: $(addprefix $(BUILDDIR)/,$(patsubst %.o,.%.m,$(notdir $(OBJECTS))))DEPEND: $(addprefix $(BUILDDIR)/,$(patsubst %.xml,.%.xml.m,$(wildcard *.xml)))all install: DEPENDnodepend: -find . -name '*.m' -exec rm {} \; -find . -name '.*.m' -exec rm {} \; -find . -name 'DEPEND' -exec rm {} \;## The following piece of idiocy works around the fact that the## autodependency files may refer to stuff that has been cleaned,## and that this can therefore perversely cause the clean target to## fail.clean: nodepend $(MAKE) $(MAKERULES) do-cleando-clean: recursive-clean -rm -f *.o *.m core *~ new.Makefile ".#"* -rm -f .*.m sysgen.map $(TARGETS) TAGS -rm -f *.dvi *.blg *.aux *.log *.toc $(CLEANLIST)ifneq "$(CLEAN_BUILDDIR)" "" -rm -rf $(CLEAN_BUILDDIR)endifrecursive-clean:ifneq "$(CLEANDIRS)" "" @for i in $(CLEANDIRS); do \ if [ -d "$$i" ]; then\ $(MAKE) -C $$i $(MAKERULES) do-clean; \ if [ $$? -ne 0 ]; then\ echo "*** RECURSIVE BUILD STOPS ***";\ exit 1;\ fi; \ fi; \ doneendif## The following piece of idiocy works around the fact that the## autodependency files may refer to stuff that has been clobbered,## and that this can therefore perversely cause the clobber target to## fail.clobber: @echo "Clobber target now obsolete: use clean instead" $(MAKE) $(MAKERULES) cleanifdef ETAGDIRSETAGEXPAND=$(patsubst %,%/*.c,$(ETAGDIRS))ETAGEXPAND+=$(patsubst %,%/*.cxx,$(ETAGDIRS))ETAGEXPAND+=$(patsubst %,%/*.hxx,$(ETAGDIRS))ETAGEXPAND+=$(patsubst %,%/*.h,$(ETAGDIRS))ASM_ETAGEXPAND+=$(patsubst %,%/*.S,$(ETAGDIRS))ETAGFILES=$(wildcard $(ETAGEXPAND))ASM_ETAGFILES=$(wildcard $(ASM_ETAGEXPAND))unexport ETAGEXPANDunexport ETAGFILESunexport ASM_ETAGEXPANDunexport ASM_ETAGFILES# --regex='/^struct[ \t]+\([A-Za-z0-9_]+\)[ \t]*:[ \t]*public[ \t]+\([A-Za-z0-9_]+\)/:public \1 \2/' \# --regex='/^class[ \t]+\([A-Za-z0-9_]+\)[ \t]*:[ \t]*public[ \t]+\([A-Za-z0-9_]+\)/:public \1 \2/' \tags: local-tags recursive-tagslocal-tags: etags \ --regex='/^struct[ \t]+\([A-Za-z0-9_]+\)[ \t]*:[ \t]*public[ \t]+\([A-Za-z0-9_]+\)/:public \1 \2/' \ --regex='/^class[ \t]+\([A-Za-z0-9_]+\)[ \t]*:[ \t]*public[ \t]+\([A-Za-z0-9_]+\)/:public \1 \2/' \ $(ETAGFILES)ifneq ($(ASM_ETAGFILES),) etags --append --lang=none \ --regex='/^\(ENTRY\|GEXT\)([A-Za-z0-9_\.]+)/' \ $(ASM_ETAGFILES)endifelsetags: recursive-tagsendifrecursive-tags:ifneq "$(DIRS)" "" @for i in $(DIRS); do \ if [ -d "$$i" ]; then\ $(MAKE) -C $$i $(MAKERULES) tags; \ if [ $$? -ne 0 ]; then\ echo "*** RECURSIVE BUILD STOPS ***";\ exit 1;\ fi; \ fi; \ doneendifgenerated: $(BUILDDIR) $(GENERATED) recursive-generatedrecursive-generated:ifneq "$(DIRS)" "" @for i in $(DIRS); do \ if [ -d "$$i" ]; then\ $(MAKE) -C $$i $(MAKERULES) generated; \ if [ $$? -ne 0 ]; then\ echo "*** RECURSIVE BUILD STOPS ***";\ exit 1;\ fi; \ fi; \ doneendif# This is a debugging target..walk:ifneq "$(DIRS)" "" @for i in $(DIRS); do \ $(MAKE) -C $$i $(MAKERULES) walk; \ if [ $$? -ne 0 ]; then\ echo "*** RECURSIVE BUILD STOPS ***";\ exit 1;\ fi; \ doneendif$(BUILDDIR)/constituents.h: $(IMGMAP) grep 'CONSTIT(' $< | \ grep -v '#define' | \ sed 's/[ ]*=.*$$//' | \ sed 's/^[^,]*, */#define /' | \ sed 's/)[^)]*$$//' | \ sed 's/,/ /' > $@
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -