# Makefile to generate the CSS2 document based on its "source files" # Arnaud Le Hors - lehors@w3.org # $Id: Makefile,v 2.122 2013-07-18 08:21:21 bbos Exp $ # what needs to be set for every new release: # Note use of full year (1998) in identifier. #THE_YEAR = 2011 THE_YEAR = $(shell date +%Y) #THE_MONTH = 06 THE_MONTH = $(shell date +%m) #THE_MONTHNAME = June THE_MONTHNAME = $(shell LANG=en_US date +%B) #THE_DAY = 07 THE_DAY = $(shell date +%d) #THE_STATUS = REC THE_STATUS = ED #THE_STATUSNAME = Recommendation THE_STATUSNAME = Editors Draft #THE_STYLE = REC THE_STYLE = ED PERMANENT_NAME = CSS2 # A very visible warning after the first H1 on every page (or at the # location of the _THE_WARNING_ placeholder on some pages). Leave # empty if none is needed. (Escape any & as \&, # as \# and " as \") # THE_WARNING =
\ \ \
\

Note: Several sections of this specification \ have been updated by other specifications. Please, see \"Cascading Style Sheets \ (CSS) \— The Official Definition\" in the latest CSS \ Snapshot for a list of specifications and the sections they \ replace. \

The CSS Working Group is also developing \ CSS level\ 2 \ revision\ 2 (CSS\ 2.2). \

\
THE_WARNING = THE_DATE = $(THE_DAY) $(THE_MONTHNAME) $(THE_YEAR) THE_ID = $(THE_STYLE)-$(PERMANENT_NAME)-$(THE_YEAR)$(THE_MONTH)$(THE_DAY) THE_LOC = $(THE_YEAR)/$(THE_ID) THIS_VERSION = http://www.w3.org/TR/$(THE_LOC) THE_LATEST_VERSION = http://www.w3.org/TR/$(PERMANENT_NAME) THE_UPDATE_DIR = http://www.w3.org/Style/css2-updates INSTALLDIR = dist/ export LC_ALL=en_US.UTF-8 ROOT = . # the following files are part of the CSS specification SRCS0 = \ cover.src SRCS1 = \ about.src\ intro.src\ conform.src\ syndata.src\ selector.src\ cascade.src\ media.src\ box.src\ visuren.src\ visudet.src\ visufx.src\ generate.src\ page.src\ colors.src\ fonts.src\ text.src\ tables.src\ ui.src\ aural.src\ zindex.src\ leftblank.src APPSRCS = \ changes.src\ sample.src\ grammar.src REFSRCS = \ refs.src INDEXSRCS= \ propidx.src \ indexlist.src MAINSRCS = $(SRCS1) REFS= $(REFSRCS:.src=.html) SPECSRCS= $(SRCS0) $(MAINSRCS) $(APPSRCS) $(INDEXSRCS) $(REFS) SPECOBJS= $(SPECSRCS:.src=.html) IMAGESSRC = \ $(wildcard images/*.eps) \ $(wildcard images/*.fig) \ $(wildcard images/*.gif) \ $(wildcard images/*.idraw) \ $(wildcard images/*.svg) \ $(wildcard images/*.ps) IMAGESBUILT = $(addsuffix .png, $(basename $(IMAGESSRC))) IMAGES = \ $(wildcard images/*.png) \ $(IMAGESBUILT) LONGDESCS = images/longdesc/*.html STYLESHEETS= style/*.css ALLOBJS= $(SPECOBJS) $(IMAGES) $(LONGDESCS) $(STYLESHEETS) PROPSRC= properties/properties.db PROPSAMPLE= properties/sample.db PROPBLKSDIR= build/properties # dbase for property name anchors PROPERTYDB= build/property.db # dbase for value types VALUEDB= build/value.db # dbase for headings HEADINGDB= build/headings.db # dbase for index terms INDEXDB = build/index.db SED = sed #PERL= perl5 -Ibin PERL= perl NSGMLS=onsgmls HTMLDECL = sgml/HTML4.decl LINKLINT=$(PERL) bin/linklint # SPELL = ispell -l -p css.dico SPELL = aspell -H -p css.dico list DIFF = diff GREP = grep LS = ls #HTML2TXT = lynx -cfg lynx.cfg -dump -nolist HTML2TXT = lynx -dump -nolist DISTILL = ps2pdf # HTML include preprocessor (for includes) HIPP= $(PERL) ./bin/hipp # make depend utility for CSS source documents HMKDEPEND= $(PERL) ./bin/hmkdep # make value anchor database MKANCHDB= $(PERL) ./bin/mkanchdb # add heading anchors ADDHANCH= $(PERL) ./bin/addhanch # add index anchors and generate related index database ADDIDXANCH= $(PERL) ./bin/addianch # add navigation bars ADDNAVBAR= $(PERL) ./bin/addnavbar # make CSS Index MKIDX= $(PERL) ./bin/mkidx # make property index MKPROPIDX= $(PERL) ./bin/mkpropidx # make table of contents and heading database MKTOC= $(PERL) ./bin/mktoc # HTML concate utility HTMLCAT= $(PERL) ./bin/htmlcat # insert subtoc INSAFTER= $(PERL) ./bin/insafter # add link ADDLINKS= $(PERL) ./bin/addlinks # extract properties from db. PEXTR= $(PERL) ./bin/pextr # check validity of sample style sheet CHKSAMPLE= $(PERL) ./bin/chksample # make database of references (reference.src) MKREFDB = $(PERL) ./bin/mkrefdb # check references. CHKREFS= $(PERL) ./bin/chkrefs # check property defs and instances CHKPROPS= $(PERL) ./bin/chkprops # add reference normative/informative class info. CHKSPACES= $(PERL) ./bin/chkspaces # check CSS examples CHKCSS= ./bin/chkcss # check XML examples CHKXML= ./bin/chkxml # Add prev/next/toc/stylesheet and other links to document MKCHAIN = $(PERL) ./bin/mkchain # Expand [[cite]] to link to bibliography ADDCITE = $(PERL) ./bin/addcite # Add special markup (e.g., keyword "Example") ADDMARKUP = $(PERL) ./bin/addmarkup # Add longdesc descriptions to images ADDLONGDESC = $(PERL) ./bin/addlongdesc # utility to generate the PostScript version # HTML2PS= $(PERL) bin/html2ps -d -f html2psrc2 PDF2PS=pdftops #HTML2PDF=prince -i html # IDRAW -> PS -> GIF tools #PSTOPNM = ./bin/mypstopnm -r 75 PSTOPNM = ./bin/mypstopnm -r 150 #PNMTOGIF_PIPE = ppmquant 256 | ppmtogif #PNMTOGIF_PIPE = pnmscale 0.5 | pnmgamma 1.7 | ppmquant -fs 256 | ppmtogif PNMTOGIF_PIPE = pnmscale 0.5 | ppmquant -fs 256 | ppmtogif # idraw -> png #PNMTOPNG_PIPE = pnmscale 0.5 | pnmgamma 1.7 | pnmtopng -gamma 1.7 PNMTOPNG_PIPE = pnmscale 0.5 | pnmtopng -gamma 1.45455 # include paths INCLUDES= -Ibuild -I. RM= rm -fr CP= cp TAR= tar ZIP= zip -y LN= ln .SUFFIXES: .src .html .srd .idraw .gif .ps .subtoc .png .fig .pdf %.subtoc: %.srd Project.cfg @echo "=========== making" $@ echo "
" >$@ echo "

Contents" >>$@ $(MKTOC) -l 2 -r $*.html $(HEADINGDB) >>$@ echo "

" >>$@ if [ `cat $@ | wc -l` = 3 ]; then $(RM) $@; touch $@; fi # Use the shorter line to avoid regenerating all .html if one .src changed, # at the cost of possibly incorrect xrefs in the other .html files # #%.html: %.subtoc Project.cfg %.html: %.subtoc $(MAINSRCS:.src=.srd) $(APPSRCS:.src=.srd) Project.cfg build/warning #$(SPECSRCS:.src=.srd) @echo "=========== making" $@ $(ADDLINKS) $(VALUEDB) $*.srd propinst-/propdef- value-inst-/value-def- |\ $(ADDIDXANCH) -r $@ $(INDEXDB) - |\ $(ADDMARKUP) - |\ $(ADDLONGDESC) - |\ $(ADDNAVBAR) -r $@ |\ $(INSAFTER) - build/warning /H1 - |\ $(INSAFTER) - $*.subtoc /H1 - |\ $(MKCHAIN) -r $@ - |\ $(SED) -e "s|_THIS_VERSION_|$(THIS_VERSION)|g" \ -e "s|_THE_LATEST_VERSION_|$(THE_LATEST_VERSION)|g" \ -e "s|_THE_STATUS_|$(THE_STATUS)|g" \ -e "s|_THE_STATUSNAME_|$(THE_STATUSNAME)|g" \ -e "s|_THE_STYLE_|$(THE_STYLE)|g" \ -e "s|_THE_DATE_|$(THE_DATE)|g" \ -e "s|_THE_WARNING_|$(THE_WARNING)|g" \ -e "s|_THE_ID_|$(THE_ID)|g" \ -e "s|_THE_UPDATE_DIR_|$(THE_UPDATE_DIR)|g" >$@ %.srd: %.src build/blocks.ok $(REFSRC:.src=.srd) @echo "=========== making" $@ $(HIPP) $(INCLUDES) $< |\ $(ADDCITE) -r $(REFS) $(REFSRCS) |\ $(ADDHANCH) -r $*.html $(HEADINGDB) - $@ $(MKANCHDB) -r $*.html value-def- $(VALUEDB) $@ $(MKANCHDB) -r $*.html propdef- $(VALUEDB) $@ %.png: %.eps; convert -density 96x96 $< $@ %.png: %.ps; convert -density 96x96 $< $@ %.png: %.idraw; convert -density 96x96 $< $@ %.png: %.svg; convert -density 96x96 $< $@ %.png: %.gif; convert -density 96x96 $< $@ %.eps: %.fig; fig2dev -L eps -F -c $< $@ #.idraw.gif: # $(RM) $@ ## $(PSTOPNM) $< | $(PPMQUANT) | $(PPMTOGIF) >$@ # $(PSTOPNM) $< | $(PNMTOGIF_PIPE) >$@ # #.idraw.png: # $(RM) $@ # $(PSTOPNM) $< | $(PNMTOPNG_PIPE) >$@ # #.fig.png: # $(RM) $@ # fig2dev -L eps $< | $(PSTOPNM) | $(PNMTOPNG_PIPE) >$@ all: build/blocks.ok $(SPECOBJS) $(IMAGES) build/warning: echo "" >$@ echo "_THE_WARNING_" >>$@ echo "" >>$@ #images/links.ok : $(IMAGES) # -@(cd images; for i in *.gif; do $(LN) -s $$i "`basename $$i .gif`" 2>//dev/null; done) # touch images/links.ok install: all css2.tgz css2.txt css2.zip css2.ps.gz css2.pdf .htaccess @if [ -z "$(INSTALLDIR)" ]; then\ echo >&2;\ echo "*** No target directory specified" >&2;\ echo "*** Please use: make install INSTALLDIR=" >&2;\ exit 1;\ fi @if [ ! -d $(INSTALLDIR) ]; then mkdir -p $(INSTALLDIR);fi $(CP) css2.txt css2.zip css2.ps.gz css2.pdf css2.tgz .htaccess $(INSTALLDIR) cat css2.tgz | (cd $(INSTALLDIR); $(TAR) xvf -) -$(RM) $(INSTALLDIR)/Overview.html (cd $(INSTALLDIR); $(LN) -s cover.html Overview.html) install-ps: install css2.ps.gz $(CP) css2.ps.gz $(INSTALLDIR) install-pdf: install css2.pdf $(CP) css2.pdf $(INSTALLDIR) # install all (except for "make link") install-all: install install-ps install-pdf css2.zip css2.txt $(CP) css2.zip css2.txt $(INSTALLDIR) #### Special section to build PS file and single plain text file extras: css2.tgz # The sources are in ISO-8859-1, make them ASCII to avoid encoding problems %.pdf: %.html style/default.css style/prince.css asc2xml < $< | xml2asc | prince -s style/prince.css -o $@ - %.ps: %.pdf; $(PDF2PS) $< $@ css2.pdf: css2.html style/default.css style/prince.css prince -s style/prince.css -o $@ $< # css2.ps: build/blocks.ok $(SPECOBJS) images/pngs.ok $(IMAGES) # # Because of memory limitations in html2ps, use the # # automagic feature that any *.gif files are not # # converted to ps if there's a *.ps file in the same # # directory. # -@(cd images; for i in *.idraw; do $(LN) -s $$i "`basename $$i .idraw`.ps"; done) # $(HTML2PS) $(SPECOBJS) > $@ #css2.ps: css2.pdf # $(PDF2PS) $< $@ css2.ps.gz: css2.ps gzip <$< >$@ # # This requires Acrobat Distiller or equivalent # css2.pdf: css2.ps # $(DISTILL) css2.ps #css2.pdf: css2.html # $(HTML2PDF) $< $@ css2.html html: $(SPECOBJS) $(HTMLCAT) - $(SPECOBJS) >$@ # the following requires to be on unix and have Netscape running... #css2.txt txt: css2.html # $(RM) css2.txt; \ # netscape -remote "openFile(`pwd`/css2.html)" -remote "saveAs(`pwd`/css2.txt,Text)" # The following requires Lynx css2.txt txt: css2.html $(HTML2TXT) css2.html >$@ #### css2.tgz: $(ALLOBJS) # images/links.ok # $(TAR) cf - $(ALLOBJS) `$(LS) -d images/*.png | $(GREP) -v "\."` | gzip >$@ $(TAR) cf - $^ | gzip >$@ css2.zip: $(ALLOBJS) $(ZIP) $@ $(ALLOBJS) # $(ZIP) $@ $(ALLOBJS) `$(LS) -d images/*.png | $(GREP) -v "\."` #### Section generate property tables from property database. build/blocks.ok: $(PROPBLKSDIR)/blocks.ok touch $@ $(PROPBLKSDIR)/blocks.ok: $(PROPSRC) @rm -rf $(PROPBLKSDIR) @mkdir -p $(PROPBLKSDIR) $(PEXTR) $(PROPSRC) $(PROPBLKSDIR) touch $@ cover.srd: cover.src build/contents.srb build/minicontents.srb Makefile @echo "=========== making" $@ $(HIPP) $(INCLUDES) $< |\ $(ADDCITE) -r $(REFS) $(REFSRCS) >$@ cover.html: cover.srd Project.cfg @echo "=========== making" $@ $(ADDNAVBAR) -r $@ $< |\ $(MKCHAIN) -r $@ - |\ $(SED) -e "s|_THIS_VERSION_|$(THIS_VERSION)|g" \ -e "s|_THE_LATEST_VERSION_|$(THE_LATEST_VERSION)|g" \ -e "s|_THE_STATUS_|$(THE_STATUS)|g" \ -e "s|_THE_STATUSNAME_|$(THE_STATUSNAME)|g" \ -e "s|_THE_STYLE_|$(THE_STYLE)|g" \ -e "s|_THE_DATE_|$(THE_DATE)|g" \ -e "s|_THE_WARNING_|$(THE_WARNING)|g" \ -e "s|_THE_YEAR_|$(THE_YEAR)|g" \ -e "s|_THE_ID_|$(THE_ID)|g" \ -e "s|_THE_UPDATE_DIR_|$(THE_UPDATE_DIR)|g" >$@ build/contents.srb: $(MAINSRCS:.src=.srd) $(APPSRCS:.src=.srd) $(REFSRCS:.src=.srd) $(INDEXSRCS:.src=.srd) Project.cfg @echo "=========== making" $@ $(MKTOC) -h 5 $(HEADINGDB) $@ build/minicontents.srb: $(MAINSRCS:.src=.srd) $(APPSRCS:.src=.srd) $(REFSRCS:.src=.srd) $(INDEXSRCS:.src=.srd) Project.cfg @echo "=========== making" $@ $(MKTOC) -h 1 $(HEADINGDB) $@ ### general index related rules build/indexlist.srb: $(MAINSRCS) $(APPSRCS) $(INDEXDB) @echo "=========== making" $@ $(MKIDX) $(INDEXDB) $@ $(INDEXDB): $(MAINSRCS:.src=.html) $(APPSRCS:.src=.html) #$(SPECSRCS:.src=.html) touch $(INDEXDB) indexlist.srd:: build/indexlist.srb #indexlist.src build/blocks.ok # @echo "=========== making" $@ # $(CP) $< $@ indexlist.html: indexlist.srd build/indexlist.srb Project.cfg build/warning @echo "=========== making" $@ $(ADDNAVBAR) -r $@ $< |\ $(INSAFTER) - build/warning /H1 - |\ $(MKCHAIN) -r $@ - |\ $(SED) -e "s|_THIS_VERSION_|$(THIS_VERSION)|g" \ -e "s|_THE_LATEST_VERSION_|$(THE_LATEST_VERSION)|g" \ -e "s|_THE_STATUS_|$(THE_STATUS)|g" \ -e "s|_THE_STATUSNAME_|$(THE_STATUSNAME)|g" \ -e "s|_THE_STYLE_|$(THE_STYLE)|g" \ -e "s|_THE_DATE_|$(THE_DATE)|g" \ -e "s|_THE_WARNING_|$(THE_WARNING)|g" \ -e "s|_THE_YEAR_|$(THE_YEAR)|g" \ -e "s|_THE_ID_|$(THE_ID)|g" \ -e "s|_THE_UPDATE_DIR_|$(THE_UPDATE_DIR)|g" >$@ build/propidx.srb: $(PROPSRC) @echo "=========== making" $@ $(MKPROPIDX) -r $@ $@ $(PROPSRC) propidx.srd:: build/propidx.srb #propidx.src # @echo "=========== making" $@ # $(HIPP) $(INCLUDES) $< $@ ### check on the document to see if it's valid check: checkdoc checkspaces checkprops checkrefs checkspell checksample checklnx checkx checkdoc: all -@echo "# Begin checking sgml." @for i in $(SPECOBJS) $(LONGDESCS); \ do echo checking $$i...; \ $(NSGMLS) -s -c sgml/HTML4.cat $(HTMLDECL) $$i; done; -@echo "# End checking sgml." ### check on the validity references in the document checkrefs: build/refs.db $(SPECOBJS) -@echo "# Begin checking references." -@$(CHKREFS) build/refs.db $(SPECOBJS) -@echo "# End checking references." build/refs.db : $(SPECSRCS) $(REFSRCS) -@$(RM) -f build/refs.db -@$(MKREFDB) $(REFSRCS) build/refs.db ### Spell check, using a "CSS" personal dictionary. checkspell: -@echo "# Begin spell checking." -@for i in $(SPECSRCS) $(LONGDESCS); \ do\ echo "Checking spelling in $$i.";\ cat $$i | $(SPELL) | sort -u;\ done; -@echo "# End spell checking." ### check the sample style sheet. checksample: sample.src $(PROPSRC) -@echo "# Begin checking sample." @$(CHKSAMPLE) sample.src $(PROPSRC) -@echo "# End checking sample." ### check links checklnx: all -@echo "# Begin checking links." -@$(RM) linklint $(LINKLINT) -doc linklint $(SPECOBJS) -@echo "# End checking links." ### check property instances checkprops: $(SPECSRCS) $(PROPSRC) -@echo "# Begin checking properties." -@$(CHKPROPS) $(PROPSRC) propinst $(SPECSRCS) -@echo "# End checking properties." # Check spaces checkspaces: $(SPECSRCS) -@echo "# Begin checking spaces." -@$(CHKSPACES) $(SPECSRCS) $(LONGDESCS) -@echo "# End checking spaces." # Check examples (CSS, HTML, XML, etc.) build/xamples.ok: $(SPECSRCS) @for i in $(SPECSRCS) ; \ do $(PERL) bin/xextr $$i build; done; @touch build/xamples.ok build/checkx.out: build/xamples.ok $(RM) build/checkx.out -@echo Begin checking HTML examples. -@for i in build/?*xampl*.html ; \ do echo checking $$i...; \ $(NSGMLS) -s -c sgml/HTML4.cat $(HTMLDECL) $$i >> build/checkx.out 2>&1; \ done; -@echo Begin checking CSS examples. $(CHKCSS) build/?*xampl*.css >> build/checkx.out 2>&1 -@echo Begin checking XML examples. $(CHKXML) build/?*xampl*.xml 2>&1 | tee -a build/checkx.out checkx: build/checkx.out @$(DIFF) checkx.out build/checkx.out >build/checkx.diff \ || echo output differs, see build/checkx.diff for details. clean: $(RM) $(SPECOBJS) $(PROPBLKSDIR)/* \ $(SPECOBJS:.html=.srd) $(SPECOBJS:.html=.subtoc) \ build/* css2.* linklint images/links.ok realclean: clean depend: $(HMKDEPEND) $(SPECOBJS) .PHONY: all install install-all clean realclean checkx ##### The following is automatically generated. Do not edit!! ####