3
0
Fork 0
websocketd/Makefile

141 lines
4.6 KiB
Makefile
Raw Normal View History

2020-07-04 22:31:17 +02:00
PACKAGE = 'websocketd'
VERSION = '0.6.0'
PREFIX := /usr/local
BINDIR := $(PREFIX)/bin
LIBDIR := $(PREFIX)/lib
SHAREDIR := $(PREFIX)/share
INCLUDEDIR := $(PREFIX)/include
MANDIR := $(SHAREDIR)/man
CRFLAGS := --release
CRFLAGS := --release
Q := @
all: websocketc websocketd
@:
websocketc: src/websocketc.cr
@echo ' CR > websocketc'
$(Q)crystal build $(CRFLAGS) src/websocketc.cr -o 'websocketc'
websocketc.install: websocketc
@echo ' IN > $(BINDIR)/websocketc'
$(Q)mkdir -p '$(DESTDIR)$(BINDIR)'
$(Q)install -m0755 websocketc $(DESTDIR)$(BINDIR)/websocketc
websocketc.clean:
@echo ' RM > websocketc'
$(Q)rm -f websocketc
websocketc.uninstall:
@echo ' RM > $(BINDIR)/websocketc'
$(Q)rm -f '$(DESTDIR)$(BINDIR)/websocketc'
websocketd: src/websocketd.cr
@echo ' CR > websocketd'
$(Q)crystal build $(CRFLAGS) src/websocketd.cr -o 'websocketd'
websocketd.install: websocketd
@echo ' IN > $(BINDIR)/websocketd'
$(Q)mkdir -p '$(DESTDIR)$(BINDIR)'
$(Q)install -m0755 websocketd $(DESTDIR)$(BINDIR)/websocketd
websocketd.clean:
@echo ' RM > websocketd'
$(Q)rm -f websocketd
websocketd.uninstall:
@echo ' RM > $(BINDIR)/websocketd'
$(Q)rm -f '$(DESTDIR)$(BINDIR)/websocketd'
$(DESTDIR)$(PREFIX):
@echo ' DIR > $(PREFIX)'
$(Q)mkdir -p $(DESTDIR)$(PREFIX)
$(DESTDIR)$(BINDIR):
@echo ' DIR > $(BINDIR)'
$(Q)mkdir -p $(DESTDIR)$(BINDIR)
$(DESTDIR)$(LIBDIR):
@echo ' DIR > $(LIBDIR)'
$(Q)mkdir -p $(DESTDIR)$(LIBDIR)
$(DESTDIR)$(SHAREDIR):
@echo ' DIR > $(SHAREDIR)'
$(Q)mkdir -p $(DESTDIR)$(SHAREDIR)
$(DESTDIR)$(INCLUDEDIR):
@echo ' DIR > $(INCLUDEDIR)'
$(Q)mkdir -p $(DESTDIR)$(INCLUDEDIR)
$(DESTDIR)$(MANDIR):
@echo ' DIR > $(MANDIR)'
$(Q)mkdir -p $(DESTDIR)$(MANDIR)
install: websocketc.install websocketd.install
@:
uninstall: websocketc.uninstall websocketd.uninstall
@:
clean: websocketc.clean websocketd.clean
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 ' TAR > $(PACKAGE)-$(VERSION).tar.gz'
$(Q)tar czf $(PACKAGE)-$(VERSION).tar.gz \
$(PACKAGE)-$(VERSION)/src/websocketc.cr \
$(PACKAGE)-$(VERSION)/src/websocketd.cr
dist-xz: $(PACKAGE)-$(VERSION).tar.xz
$(PACKAGE)-$(VERSION).tar.xz: distdir
@echo ' TAR > $(PACKAGE)-$(VERSION).tar.xz'
$(Q)tar cJf $(PACKAGE)-$(VERSION).tar.xz \
$(PACKAGE)-$(VERSION)/src/websocketc.cr \
$(PACKAGE)-$(VERSION)/src/websocketd.cr
dist-bz2: $(PACKAGE)-$(VERSION).tar.bz2
$(PACKAGE)-$(VERSION).tar.bz2: distdir
@echo ' TAR > $(PACKAGE)-$(VERSION).tar.bz2'
$(Q)tar cjf $(PACKAGE)-$(VERSION).tar.bz2 \
$(PACKAGE)-$(VERSION)/src/websocketc.cr \
$(PACKAGE)-$(VERSION)/src/websocketd.cr
help:
@echo ' :: websocketd-0.6.0'
@echo ''
@echo 'Generic targets:'
@echo ' - help  Prints this help message.'
@echo ' - all  Builds all targets.'
@echo ' - dist  Creates tarballs of the files of the project.'
@echo ' - install  Installs the project.'
@echo ' - clean  Removes compiled files.'
@echo ' - uninstall  Deinstalls the project.'
@echo ''
@echo 'CLI-modifiable variables:'
@echo ' - CRFLAGS  ${CRFLAGS}'
@echo ' - CRFLAGS  ${CRFLAGS}'
@echo ' - PREFIX  ${PREFIX}'
@echo ' - BINDIR  ${BINDIR}'
@echo ' - LIBDIR  ${LIBDIR}'
@echo ' - SHAREDIR  ${SHAREDIR}'
@echo ' - INCLUDEDIR  ${INCLUDEDIR}'
@echo ' - MANDIR  ${MANDIR}'
@echo ''
@echo 'Project targets: '
@echo ' - websocketc  crystal'
@echo ' - websocketd  crystal'
@echo ''
@echo 'Makefile options:'
@echo ' - gnu: false'
@echo ' - colors: true'
@echo ''
@echo 'Rebuild the Makefile with:'
@echo ' zsh ./build.zsh -c'
.PHONY: all clean distclean dist install uninstall help