css / Mykefile

PREFIX          = /opt/css
weblocal        = $(HOME)/@/ezos/html/cs/css

target  = bin

rewrite = rewriteif -0 -v

JAVADIR	= $(ETCDIR)/www/java/classes
java	= $(localjava) $(subjava)
localjava= $('*.java' G)
subjava	= $('cs/*.java' G?)
classes	= $((java P)).class
subclasses=$((subjava P)).class
html	= $('*.html' G)

htdocs	= $(HOME)/@/ezos/html/cs
htmandir = $(htdocs)/css/manuals
pmsets	= lib/cs
pmset(set) = $('$(set)/*.pm' EG?) \
	     $('$(set)/*/*.pm' EG?) \
	     $('$(set)/*/*/*.pm' EG?)
pmsetmans(set) = $(MANDIR)/man3/$(('$(pmset($(set)))' Es[/]P s:|/|::|)).3
pmsethtml(set) = $(htmandir)/$(('$(pmset($(set)))' Es[/]P s:|/|::|)).3.html
pmmans = $('$$(pmsetmans($((pmsets))))' EE)
pmhtml = $('$$(pmsethtml($((pmsets))))' EE)
podman(podf) = $(MANDIR)/man$(podf FPS)/$(podf FP)
podmans = $('$$(podman($(("man/*.pod" G))))' EE)
pmFromMan(manf) = lib/$(manf FP s:|::|/|).pm
pmFromHtml(html) = lib/$(html FPP s:|::|/|).pm
podFromMan(manf) = man/$(manf F).pod

subdirs = $('*/.' GD)
allscripts = $('bin/*' GF !/\./ + "rc.mobile")

scriptmandir = $(MANDIR)/man1
scriptmans = $(scriptmandir)/$((allscripts)).1
scriptfromman(manf) = $(manf FP)

_help:
        @echo '_home      - deploy scripts to ~/bin etc'
        @echo '_deploy    - deploy current release to /opt/css'
        @echo '_publish   - deploy current release to /opt/css and ezos'
        @echo '_pending   - report unreleased changelog and [M]odified files'
        @echo '_release   - mark tip as new release'
        @echo '_freshmeat - announce current release to freshmeat'

_home:
        skip=`hg status | sed -n 's:^? \(.*\):--exclude=/\1:p'` \
        set-x \\
        qrsync -a --delete \\
                --include=/CHANGELOG.txt \\
                $$skip \\
                --include=bos/ \\
                --include=stubs/ \\
                --include=synonyms/ \\
                --exclude=squid_redirect \\
                --exclude=*.swp \\
                --exclude=/\*/ \\
                bin/. $(HOME)/bin/. \
        set-x qrsync -a bos/. $(HOME)/bin-bos/. \
        set-x qrsync -a bin-cs/. $(HOME)/bin-cs/. \
        set-x \\
        qrsync -a --delete \\
                --include=/CHANGELOG.txt \\
                $$skip \\
                --exclude=*.pyc \\
                --exclude=*.swp \\
                lib/cs/. $(HOME)/lib/cs/.

# squid_redirect
_all: 1INDEX.txt _submakes _man

_deploy:
        :make _home
        OPTCSS=$(PREFIX) updcss

_publish:
        :make _deploy
        syncezos

# mark the tip as a new release
_release:
        cs-release add

_pending:
        cs-release log
        hg status | grep '^[^?]'; :

_freshmeat:
        cs-release freshmeat-submit

CHANGELOG.txt:	_always
	>>$@; $(rewrite) $@ hglog

CHANGELOG.html:	_always
	>>$@; $(rewrite) $@ cvslog2html -O .

1INDEX.txt: $(allscripts)
	@echo make $@ \
         ( cat INSTALL; mkscriptndx `ls -d $(allscripts) | sort` ) >$@

_test:
	echo $(pmmans)

_man:
        :make _podmans
        :make _pmmans
        :make _scriptmans

_podmans: $(podmans)

$(podmans):     $(podFromMan($@))
        :make $(@D)/.
        >>$@; $(rewrite) $@ pod2man --center="Cameron Simpson Scripts: $?" $?
        chmod 644 $@
        set -uex; htman=$(htmandir)/$(@F).html \
        >>$$htman; $(rewrite) $$htman pod2html --title="Cameron Simpson Scripts: $?" $? \
        chmod 644 $$htman

_pmmans: $(pmmans)

$(pmmans):	$(pmFromMan($@))
	:make $(@D)/.
	@if grep '^=head1 NAME' <$? >/dev/null \
	then \
	    >>$@; $(rewrite) $@ pod2man --center="Cameron Simpson Scripts: $?" $? \
	    chmod 644 $@ \
	    htman=$(htmandir)/$(@F).html \
	    >>$$htman; $(rewrite) $$htman pod2html --title="Cameron Simpson Scripts: $?" $? \
	    chmod 644 $$htman \
	else \
	    : \
	fi

_scriptmans:
	@echo make $@ ... \
        ( cd bin; exec egrep -l '^(# *)?=head1 NAME' $(allscripts) ) \\
	| sed 's|.*|$(scriptmandir)/&.1|' \\
	| xxargs $(MAKE) MANDIR=$(MANDIR)

$(scriptmandir)/%.1: bin/%
	:make $(@D)/.
	@htman=$(htmandir)/$(@F).html \
	 case "`sed 1q <$?`" in \
	    '#!/usr/bin/perl'*) \
		grep '^=head1 NAME' <$? >/dev/null || exit 0 \
		>>$@; $(rewrite) $@ pod2man --release=CSS --section=1cs --center="Cameron Simpson's Scripts" $? \
		>>$$htman; $(rewrite) $$htman pod2html --title="Cameron Simpson's Scripts: $?" $? \
		;; \
	    *) \
		grep '^# *=head1 NAME' <$? >/dev/null || exit 0 \
		tmp=$${TMPDIR:-/tmp}/$(@F).$$ \
		unhashpod <$? >$$tmp \
		>>$@; $(rewrite) $@ pod2man --section=1cs --center="Cameron Simpson's Scripts" $$tmp \
		>>$$htman; $(rewrite) $$htman pod2html --title="Cameron Simpson's Scripts: $?" $$tmp \
		rm $$tmp \
		;; \
	 esac \
	 chmod 644 $@ $$htman

noads	= $(HOME)/@/adzapper.sf/html/rc/patterns

squid_redirect: $(noads)
	@cd $(?DD) || exit 1 \
	pwd; set -x \
	exec $(MAKE) _scripts

%.class: %.java %.class-prereqs : $(("%.class-prereqs" G?<P)).class
	:make $(("$@-prereqs" E<P)).class
	$(JAVAC) $(@P).java

%.class-prereqs: %.java
	javaprereqs $(@P).java >$@
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.