2019-11-20 19:22:51 +01:00
|
|
|
|
PACKAGE = 'todo-webclient'
|
|
|
|
|
VERSION = '0.1'
|
|
|
|
|
|
|
|
|
|
PREFIX := /usr/local
|
|
|
|
|
BINDIR := $(PREFIX)/bin
|
|
|
|
|
LIBDIR := $(PREFIX)/lib
|
|
|
|
|
SHAREDIR := $(PREFIX)/share
|
|
|
|
|
INCLUDEDIR := $(PREFIX)/include
|
|
|
|
|
MANDIR := $(SHAREDIR)/man
|
2019-11-22 16:52:50 +01:00
|
|
|
|
CRFLAGS := --release
|
2019-11-20 19:22:51 +01:00
|
|
|
|
|
|
|
|
|
Q := @
|
|
|
|
|
|
2019-11-22 16:52:50 +01:00
|
|
|
|
all: todoc main.js style.css
|
2019-11-20 19:22:51 +01:00
|
|
|
|
@:
|
|
|
|
|
|
2019-11-22 16:52:50 +01:00
|
|
|
|
todoc: src/client.cr
|
|
|
|
|
@echo '[01;35m CR > [01;37mtodoc[00m'
|
|
|
|
|
$(Q)crystal build $(CRFLAGS) src/client.cr -o 'todoc'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
todoc.install: todoc
|
|
|
|
|
@echo '[01;31m IN > [01;37m$(BINDIR)/todoc[00m'
|
|
|
|
|
$(Q)mkdir -p '$(DESTDIR)$(BINDIR)'
|
|
|
|
|
$(Q)install -m0755 todoc $(DESTDIR)$(BINDIR)/todoc
|
|
|
|
|
|
|
|
|
|
todoc.clean:
|
|
|
|
|
@echo '[01;37m RM > [01;37mtodoc[00m'
|
|
|
|
|
$(Q)rm -f todoc
|
|
|
|
|
|
|
|
|
|
todoc.uninstall:
|
|
|
|
|
@echo '[01;37m RM > [01;37m$(BINDIR)/todoc[00m'
|
|
|
|
|
$(Q)rm -f '$(DESTDIR)$(BINDIR)/todoc'
|
|
|
|
|
|
2019-11-20 19:22:51 +01:00
|
|
|
|
main.js: main.bundle.js
|
|
|
|
|
@echo '[01;31m MIN > [01;37mmain.js[00m'
|
|
|
|
|
$(Q)npx babel --minified main.bundle.js -o main.js
|
|
|
|
|
|
|
|
|
|
|
2019-12-06 04:07:19 +01:00
|
|
|
|
main.bundle.js: client/index.ls client/authd.ls client/bulma.ls client/card.ls client/modal.ls client/project.ls client/TaskCreationModal.ls client/task.ls client/task-removal-modal.ls client/todowebsocket.ls client/validation-modal.ls
|
2019-11-20 19:22:51 +01:00
|
|
|
|
@echo '[01;32m BUN > [01;37mmain.bundle.js[00m'
|
|
|
|
|
$(Q)npx browserify -t browserify-livescript client/index.ls -o main.bundle.js
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
main.js.install: main.js
|
|
|
|
|
@echo '[01;31m IN > [01;37m$(SHAREDIR)/todo-webclient/main.js[00m'
|
|
|
|
|
$(Q)mkdir -p '$(DESTDIR)$(SHAREDIR)/todo-webclient'
|
|
|
|
|
$(Q)install -m644 main.js $(DESTDIR)$(SHAREDIR)/todo-webclient/main.js
|
|
|
|
|
|
|
|
|
|
main.js.clean:
|
|
|
|
|
@echo '[01;37m RM > [01;37mmain.js[00m'
|
|
|
|
|
$(Q)rm -f main.js
|
|
|
|
|
@echo '[01;37m RM > [01;37mmain.bundle.js[00m'
|
|
|
|
|
$(Q)rm -f main.bundle.js
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
main.js.uninstall:
|
|
|
|
|
@echo '[01;37m RM > [01;37m$(SHAREDIR)/todo-webclient/main.js[00m'
|
|
|
|
|
$(Q)rm -f '$(DESTDIR)$(SHAREDIR)/todo-webclient/main.js'
|
|
|
|
|
|
|
|
|
|
style.css: client/style.sass
|
|
|
|
|
@echo '[01;33m CSS > [01;37mstyle.css[00m'
|
|
|
|
|
$(Q)sassc client/style.sass > style.css
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
style.css.install: style.css
|
|
|
|
|
@echo '[01;31m IN > [01;37m$(SHAREDIR)/todo-webclient/style.css[00m'
|
|
|
|
|
$(Q)mkdir -p '$(DESTDIR)$(SHAREDIR)/todo-webclient'
|
|
|
|
|
$(Q)install -m644 style.css $(DESTDIR)$(SHAREDIR)/todo-webclient/style.css
|
|
|
|
|
|
|
|
|
|
style.css.clean:
|
|
|
|
|
@echo '[01;37m RM > [01;37mstyle.css[00m'
|
|
|
|
|
$(Q)rm -f style.css
|
|
|
|
|
|
|
|
|
|
style.css.uninstall:
|
|
|
|
|
@echo '[01;37m RM > [01;37m$(SHAREDIR)/todo-webclient/style.css[00m'
|
|
|
|
|
$(Q)rm -f '$(DESTDIR)$(SHAREDIR)/todo-webclient/style.css'
|
|
|
|
|
|
|
|
|
|
$(DESTDIR)$(PREFIX):
|
|
|
|
|
@echo '[01;35m DIR > [01;37m$(PREFIX)[00m'
|
|
|
|
|
$(Q)mkdir -p $(DESTDIR)$(PREFIX)
|
|
|
|
|
$(DESTDIR)$(BINDIR):
|
|
|
|
|
@echo '[01;35m DIR > [01;37m$(BINDIR)[00m'
|
|
|
|
|
$(Q)mkdir -p $(DESTDIR)$(BINDIR)
|
|
|
|
|
$(DESTDIR)$(LIBDIR):
|
|
|
|
|
@echo '[01;35m DIR > [01;37m$(LIBDIR)[00m'
|
|
|
|
|
$(Q)mkdir -p $(DESTDIR)$(LIBDIR)
|
|
|
|
|
$(DESTDIR)$(SHAREDIR):
|
|
|
|
|
@echo '[01;35m DIR > [01;37m$(SHAREDIR)[00m'
|
|
|
|
|
$(Q)mkdir -p $(DESTDIR)$(SHAREDIR)
|
|
|
|
|
$(DESTDIR)$(INCLUDEDIR):
|
|
|
|
|
@echo '[01;35m DIR > [01;37m$(INCLUDEDIR)[00m'
|
|
|
|
|
$(Q)mkdir -p $(DESTDIR)$(INCLUDEDIR)
|
|
|
|
|
$(DESTDIR)$(MANDIR):
|
|
|
|
|
@echo '[01;35m DIR > [01;37m$(MANDIR)[00m'
|
|
|
|
|
$(Q)mkdir -p $(DESTDIR)$(MANDIR)
|
2019-11-22 16:52:50 +01:00
|
|
|
|
install: todoc.install main.js.install style.css.install
|
2019-11-20 19:22:51 +01:00
|
|
|
|
@:
|
|
|
|
|
|
2019-11-22 16:52:50 +01:00
|
|
|
|
uninstall: todoc.uninstall main.js.uninstall style.css.uninstall
|
2019-11-20 19:22:51 +01:00
|
|
|
|
@:
|
|
|
|
|
|
2019-11-22 16:52:50 +01:00
|
|
|
|
clean: todoc.clean main.js.clean style.css.clean
|
2019-11-20 19:22:51 +01:00
|
|
|
|
distclean: clean
|
|
|
|
|
dist: dist-gz dist-xz dist-bz2
|
|
|
|
|
$(Q)rm -- $(PACKAGE)-$(VERSION)
|
|
|
|
|
|
|
|
|
|
distdir:
|
|
|
|
|
$(Q)rm -rf -- $(PACKAGE)-$(VERSION)
|
|
|
|
|
$(Q)ln -s -- . $(PACKAGE)-$(VERSION)
|
|
|
|
|
|
|
|
|
|
dist-gz: $(PACKAGE)-$(VERSION).tar.gz
|
|
|
|
|
$(PACKAGE)-$(VERSION).tar.gz: distdir
|
|
|
|
|
@echo '[01;33m TAR > [01;37m$(PACKAGE)-$(VERSION).tar.gz[00m'
|
|
|
|
|
$(Q)tar czf $(PACKAGE)-$(VERSION).tar.gz \
|
2019-11-22 16:52:50 +01:00
|
|
|
|
$(PACKAGE)-$(VERSION)/src/client.cr \
|
2019-11-20 19:22:51 +01:00
|
|
|
|
$(PACKAGE)-$(VERSION)/client/index.ls \
|
|
|
|
|
$(PACKAGE)-$(VERSION)/client/style.sass \
|
|
|
|
|
$(PACKAGE)-$(VERSION)/client/authd.ls \
|
|
|
|
|
$(PACKAGE)-$(VERSION)/client/bulma.ls \
|
2019-12-06 04:07:19 +01:00
|
|
|
|
$(PACKAGE)-$(VERSION)/client/card.ls \
|
2019-12-04 23:30:12 +01:00
|
|
|
|
$(PACKAGE)-$(VERSION)/client/modal.ls \
|
2019-11-22 16:52:50 +01:00
|
|
|
|
$(PACKAGE)-$(VERSION)/client/project.ls \
|
2019-12-06 01:56:32 +01:00
|
|
|
|
$(PACKAGE)-$(VERSION)/client/TaskCreationModal.ls \
|
2019-11-22 16:52:50 +01:00
|
|
|
|
$(PACKAGE)-$(VERSION)/client/task.ls \
|
2019-12-06 04:07:19 +01:00
|
|
|
|
$(PACKAGE)-$(VERSION)/client/task-removal-modal.ls \
|
2019-12-05 01:45:21 +01:00
|
|
|
|
$(PACKAGE)-$(VERSION)/client/todowebsocket.ls \
|
|
|
|
|
$(PACKAGE)-$(VERSION)/client/validation-modal.ls
|
2019-11-20 19:22:51 +01:00
|
|
|
|
|
|
|
|
|
dist-xz: $(PACKAGE)-$(VERSION).tar.xz
|
|
|
|
|
$(PACKAGE)-$(VERSION).tar.xz: distdir
|
|
|
|
|
@echo '[01;33m TAR > [01;37m$(PACKAGE)-$(VERSION).tar.xz[00m'
|
|
|
|
|
$(Q)tar cJf $(PACKAGE)-$(VERSION).tar.xz \
|
2019-11-22 16:52:50 +01:00
|
|
|
|
$(PACKAGE)-$(VERSION)/src/client.cr \
|
2019-11-20 19:22:51 +01:00
|
|
|
|
$(PACKAGE)-$(VERSION)/client/index.ls \
|
|
|
|
|
$(PACKAGE)-$(VERSION)/client/style.sass \
|
|
|
|
|
$(PACKAGE)-$(VERSION)/client/authd.ls \
|
|
|
|
|
$(PACKAGE)-$(VERSION)/client/bulma.ls \
|
2019-12-06 04:07:19 +01:00
|
|
|
|
$(PACKAGE)-$(VERSION)/client/card.ls \
|
2019-12-04 23:30:12 +01:00
|
|
|
|
$(PACKAGE)-$(VERSION)/client/modal.ls \
|
2019-11-22 16:52:50 +01:00
|
|
|
|
$(PACKAGE)-$(VERSION)/client/project.ls \
|
2019-12-06 01:56:32 +01:00
|
|
|
|
$(PACKAGE)-$(VERSION)/client/TaskCreationModal.ls \
|
2019-11-22 16:52:50 +01:00
|
|
|
|
$(PACKAGE)-$(VERSION)/client/task.ls \
|
2019-12-06 04:07:19 +01:00
|
|
|
|
$(PACKAGE)-$(VERSION)/client/task-removal-modal.ls \
|
2019-12-05 01:45:21 +01:00
|
|
|
|
$(PACKAGE)-$(VERSION)/client/todowebsocket.ls \
|
|
|
|
|
$(PACKAGE)-$(VERSION)/client/validation-modal.ls
|
2019-11-20 19:22:51 +01:00
|
|
|
|
|
|
|
|
|
dist-bz2: $(PACKAGE)-$(VERSION).tar.bz2
|
|
|
|
|
$(PACKAGE)-$(VERSION).tar.bz2: distdir
|
|
|
|
|
@echo '[01;33m TAR > [01;37m$(PACKAGE)-$(VERSION).tar.bz2[00m'
|
|
|
|
|
$(Q)tar cjf $(PACKAGE)-$(VERSION).tar.bz2 \
|
2019-11-22 16:52:50 +01:00
|
|
|
|
$(PACKAGE)-$(VERSION)/src/client.cr \
|
2019-11-20 19:22:51 +01:00
|
|
|
|
$(PACKAGE)-$(VERSION)/client/index.ls \
|
|
|
|
|
$(PACKAGE)-$(VERSION)/client/style.sass \
|
|
|
|
|
$(PACKAGE)-$(VERSION)/client/authd.ls \
|
|
|
|
|
$(PACKAGE)-$(VERSION)/client/bulma.ls \
|
2019-12-06 04:07:19 +01:00
|
|
|
|
$(PACKAGE)-$(VERSION)/client/card.ls \
|
2019-12-04 23:30:12 +01:00
|
|
|
|
$(PACKAGE)-$(VERSION)/client/modal.ls \
|
2019-11-22 16:52:50 +01:00
|
|
|
|
$(PACKAGE)-$(VERSION)/client/project.ls \
|
2019-12-06 01:56:32 +01:00
|
|
|
|
$(PACKAGE)-$(VERSION)/client/TaskCreationModal.ls \
|
2019-11-22 16:52:50 +01:00
|
|
|
|
$(PACKAGE)-$(VERSION)/client/task.ls \
|
2019-12-06 04:07:19 +01:00
|
|
|
|
$(PACKAGE)-$(VERSION)/client/task-removal-modal.ls \
|
2019-12-05 01:45:21 +01:00
|
|
|
|
$(PACKAGE)-$(VERSION)/client/todowebsocket.ls \
|
|
|
|
|
$(PACKAGE)-$(VERSION)/client/validation-modal.ls
|
2019-11-20 19:22:51 +01:00
|
|
|
|
|
|
|
|
|
help:
|
|
|
|
|
@echo '[01;37m :: todo-webclient-0.1[00m'
|
|
|
|
|
@echo ''
|
|
|
|
|
@echo '[01;37mGeneric targets:[00m'
|
|
|
|
|
@echo '[00m - [01;32mhelp [37m Prints this help message.[00m'
|
|
|
|
|
@echo '[00m - [01;32mall [37m Builds all targets.[00m'
|
|
|
|
|
@echo '[00m - [01;32mdist [37m Creates tarballs of the files of the project.[00m'
|
|
|
|
|
@echo '[00m - [01;32minstall [37m Installs the project.[00m'
|
|
|
|
|
@echo '[00m - [01;32mclean [37m Removes compiled files.[00m'
|
|
|
|
|
@echo '[00m - [01;32muninstall [37m Deinstalls the project.[00m'
|
|
|
|
|
@echo ''
|
|
|
|
|
@echo '[01;37mCLI-modifiable variables:[00m'
|
2019-11-22 16:52:50 +01:00
|
|
|
|
@echo ' - [01;34mCRFLAGS [37m ${CRFLAGS}[00m'
|
2019-11-20 19:22:51 +01:00
|
|
|
|
@echo ' - [01;34mPREFIX [37m ${PREFIX}[00m'
|
|
|
|
|
@echo ' - [01;34mBINDIR [37m ${BINDIR}[00m'
|
|
|
|
|
@echo ' - [01;34mLIBDIR [37m ${LIBDIR}[00m'
|
|
|
|
|
@echo ' - [01;34mSHAREDIR [37m ${SHAREDIR}[00m'
|
|
|
|
|
@echo ' - [01;34mINCLUDEDIR [37m ${INCLUDEDIR}[00m'
|
|
|
|
|
@echo ' - [01;34mMANDIR [37m ${MANDIR}[00m'
|
|
|
|
|
@echo ''
|
|
|
|
|
@echo '[01;37mProject targets: [00m'
|
2019-11-22 16:52:50 +01:00
|
|
|
|
@echo ' - [01;33mtodoc [37m crystal[00m'
|
2019-11-20 19:22:51 +01:00
|
|
|
|
@echo ' - [01;33mmain.js [37m livescript[00m'
|
|
|
|
|
@echo ' - [01;33mstyle.css [37m sass[00m'
|
|
|
|
|
@echo ''
|
|
|
|
|
@echo '[01;37mMakefile options:[00m'
|
|
|
|
|
@echo ' - gnu: false'
|
|
|
|
|
@echo ' - colors: true'
|
|
|
|
|
@echo ''
|
|
|
|
|
@echo '[01;37mRebuild the Makefile with:[00m'
|
|
|
|
|
@echo ' zsh ./build.zsh -c'
|
|
|
|
|
.PHONY: all clean distclean dist install uninstall help
|
|
|
|
|
|