For use with (GNU) make

Every .m4 file runs through m4, and then my Powershell actually processes the results (pipelined) to create the .inc file.

Then the template HTML file gets ran through m4, where the .inc files are included where you tell them to be placed by the template file.

I then copy the file to various places, and upload them (if I have to, Dropbox is automatic). In fact, if you don't want to go through the hosting, you could just use Dropbox, create a short url to it after making it public, and not even have to worry about it, just copy it to your Dropbox.

You could even make it a PHP file, if your host supports it. I'm only using javascript for one thing, the date of when the file was created.

You can set however you want to set it. And this file names all the names.

If you can figure out how get a generic .m4 to .inc (and .txt to .inc) working, I'd like to know. I can't seem to get it working with GNU make.

I also include the .css and .js files so that I have one place to edit them, and then they propagate. I could create hard links I guess.

# makefile for linkstomonitor.html

.SUFFIXES: .inc .txt .m4

POWERSHELL =  powershell
PSFLAGS =  -NoLogo -ExecutionPolicy Unrestricted -File

FTPDIR = d:\ftp\public_html

INCLUDES = \ \ \


all:    linkstomonitor.html $(FTPDIR)\linkstomonitor.html $(FTPDIR)\linkstomonitor.css $(FTPDIR)\linkstomonitor.js

linkstomonitor.html: $(INCLUDES) $(INCLUDEST) template.html
    m4 <template.html >linkstomonitor.html
# upload file(s) then.

$(INCLUDES): %.m4
# delete old destination file
    rm $@
    $(POWERSHELL) $(PSFLAGS) .\process-file.ps1 $<

$(INCLUDEST): %.txt
# delete old destination file
    rm $@
    $(POWERSHELL) $(PSFLAGS) .\process-shorts.ps1 $<

$(FTPDIR)\linkstomonitor.html: linkstomonitor.html
    copy /y linkstomonitor.html d:\ftp\public_html
    copy /y linkstomonitor.html d:\ftp\
    copy /y linkstomonitor.html "e:\My Dropbox\Public\"

$(FTPDIR)\linkstomonitor.css: linkstomonitor.css
    copy /y linkstomonitor.css d:\ftp\public_html
    copy /y linkstomonitor.css d:\ftp\
    copy /y linkstomonitor.css "e:\My Dropbox\Public\"

$(FTPDIR)\linkstomonitor.js: linkstomonitor.js
    copy /y linkstomonitor.js d:\ftp\public_html
    copy /y linkstomonitor.js d:\ftp\
    copy /y linkstomonitor.js "e:\My Dropbox\Public\"

    rm -f *.inc

link page generator

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License