aboutsummaryrefslogtreecommitdiff
path: root/Makefile
blob: 40dcea905ba286269d4d88bd8d59b0fd63d5378b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# -*- make -*-
# FILE: "/home/evmik/src/my_src/GradeBook/Makefile"
# LAST MODIFICATION: "Mon, 30 Jan 2012 11:09:22 -0500 (evmik)"
# (C) 2011 by Eugeniy Mikhailov, <evgmik@gmail.com>
# $Id:$
#

TOPDIR=$(shell pwd)
GIT_VERSION:="$(shell git describe --tags --always) ($(shell git log --pretty=format:%cd --date=short -n1), branch $(shell [ -f $(TOPDIR)/.git/HEAD ] && sed 's/ref: refs\/heads\/\(.*\)/\\\\\\"\1\\\\\\"/g' $(TOPDIR)/.git/HEAD || echo 'unknown'))"
VERSION:=$(shell git describe --tags --abbrev=0)

upscr = rsync  -ave ssh
upload_location_code = physics.wm.edu:public_html/cgi-bin/
upload_location_styles = physics.wm.edu:public_html/
upload_location_javascript = physics.wm.edu:public_html/
upload_location_icons = physics.wm.edu:public_html/icons/

cgi_code_files = ./GradeBook.tcl ./GradeBook_lib.tcl ./libBasicTableOperations.tcl ./txtPlot.tcl
files4upload_code   = $(cgi_code_files) ./gb_config.tcl
files4upload_styles = ./GradeBook.css 
files4upload_javascript = ./GradeBook.js

files4upload_icons = $(wildcard ./icons/*.png)

default: config


upload_cgi: upload_code upload_styles upload_icons

upload_icons:
	$(upscr) $(files4upload_icons) $(upload_location_icons)

upload_code: config
	$(upscr) $(files4upload_code) $(upload_location_code)

upload_styles: style
	$(upscr) $(files4upload_styles) $(upload_location_styles)

upload_javascript:
	$(upscr) $(files4upload_javascript) $(upload_location_javascript)

style: GradeBook.css

GradeBook.css: GradeBook.scss
	sass $<   > $@

config: gb_config.tcl

gb_config.tcl: gb_config.template $(cgi_code_files)
	sed s/__VERSION__/{$(GIT_VERSION)}/ < $< > $@