Files
gnatdashboard/webui/Makefile
Monika Kurovszky 5a7595ceac GNAThub makefiles patch for Windows build
Change-Id: Ida20e69a4349a183bb71167247ea8843dd43544c
2018-03-09 11:47:29 +01:00

75 lines
1.8 KiB
Makefile

# Makefile for WebUI - the GNATdashboard Web Interface.
# General conventions for Makefiles
SHELL = /bin/sh
.SUFFIXES:
# Common prefix for installation directories.
# NOTE: This directory must exist when you start the install.
prefix = /usr/local
exec_prefix = $(prefix)
bindir = $(exec_prefix)/bin
libdir = $(exec_prefix)/lib
libexecdir = $(exec_prefix)/libexec
datarootdir = $(prefix)/share
datadir = $(datarootdir)
mkfile := $(abspath $(lastword $(MAKEFILE_LIST)))
rootdir := $(patsubst %/,%,$(dir $(mkfile)))
srcdir = $(rootdir)/src
builddir = $(rootdir)
# Command variables
CP = cp
RM = rm
RMDIR = rm -r
MKDIR = install -d
CHMOD = chmod
INSTALL = install
INSTALL_PROGRAM = $(INSTALL)
INSTALL_DATA = ${INSTALL} -m 644
NPM = npm
BUILD_MODE = dev
SOURCES := $(shell find $(srcdir) \
-name '*.ts' -or -name '*.scss' -or -name '*.html')
.PHONY:
# Standard targets for users
all: $(builddir)/dist/index.html
install: all installdirs
(cd $(builddir) && tar cf - dist) | \
(cd "$(DESTDIR)$(datadir)/gnathub/webui" && tar xf - --strip-components 1)
install-strip:
$(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' install
test: $(rootdir)/package.json
$(NPM) run test
clean:
-$(RMDIR) $(rootdir)/typings
-$(RMDIR) $(rootdir)/coverage
distclean: clean
-$(RMDIR) $(builddir)/dist
-$(RMDIR) $(rootdir)/node_modules
installdirs:
$(MKDIR) $(DESTDIR)$(bindir)
$(MKDIR) $(DESTDIR)$(datadir)/gnathub
$(MKDIR) $(DESTDIR)$(datadir)/gnathub/webui
# Custom targets for this project
$(builddir)/dist/index.html: $(rootdir)/package.json $(SOURCES) \
$(srcdir)/index.html $(rootdir)/node_modules/.installed
BUILD_DIR=$(builddir) $(NPM) run build:$(BUILD_MODE)
install-node-modules: $(rootdir)/node_modules/.installed
$(rootdir)/node_modules/.installed: $(rootdir)/package.json
(cd $(rootdir) && $(NPM) install && touch $@)