My website. http://www.vilor.one/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

58 lines
1.9 KiB

# Copyright (C) 2022 Ivan Polyakov
#
# This file is part of vilor's website.
#
# Vilor's website 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 3 of the License, or
# (at your option) any later version.
#
# Vilor's website 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, see <https://www.gnu.org/licenses/>.
include config.mk
DIRS := $(shell find $(SRCDIR)/pages/* -type d | sed 's/$(SRCDIR)\/pages/$(OUTDIR)/')
SRCPAGES := $(shell find $(SRCDIR)/pages/* -name '*.scm')
SRCSTYLES := $(shell find $(SRCDIR)/styles/* -name '*.scm')
OUTSTYLES := $(shell find $(SRCDIR)/styles/ -type f -name '*.scm' | sed 's/$(SRCDIR)\/styles/$(OUTDIR)/')
OUTSTYLES := $(OUTSTYLES:%.scm=%.css)
SRCJS := $(shell find $(SRCDIR)/scripts/* -name '*.js')
OUTJS := $(shell find $(SRCDIR)/scripts/ -type f -name '*.js' | sed 's/$(SRCDIR)\/scripts/$(OUTDIR)/')
all: $(OUTDIR) $(STATICDIR) pages $(OUTSTYLES) $(OUTJS)
pages: $(SRCPAGES)
for page in $(SRCPAGES) ; do \
$(SCHEME) $(SCHEMEFLAGS) $$page \
| sed -f scripts/minify-html.sed \
> $$(echo $$page | sed 's/.*\/pages/dist/' | sed 's/scm/xhtml/') \
; done
$(OUTSTYLES): $(SRCSTYLES)
$(SCHEME) $(SCHEMEFLAGS) $< > $@
$(OUTJS): $(SRCJS)
for script in $(SRCJS) ; do \
cp $$script $$(echo $$script | sed 's/.*\/scripts/dist/') \
; done
$(OUTDIR):
mkdir -p $(OUTDIR)
mkdir -p $(DIRS)
$(STATICDIR): $(OUTDIR)
cp -rf $@/* $< || echo $(STATICDIR) "dir is empty"
cp COPYING dist/
clean:
rm -rf $(OUTDIR)
.PHONY: all $(OUTDIR) $(STATICDIR) clean