mirror of
https://github.com/flynx/ImageGrid.git
synced 2025-10-29 10:20:08 +00:00
ironed out most of the windows/linux electron build compatibility stuff in the makefile, now need osX hardware ;)
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
b501bb0c7c
commit
25dbde80ad
@ -29,17 +29,18 @@
|
|||||||
#**********************************************************************
|
#**********************************************************************
|
||||||
# variables...
|
# variables...
|
||||||
|
|
||||||
APP_NAME = ImageGrid.Viewer
|
APP_NAME ?= ImageGrid.Viewer
|
||||||
|
|
||||||
|
|
||||||
# Electron stuff...
|
# Electron stuff...
|
||||||
# XXX Linux does not let an app run if some of the libs it is linked
|
#
|
||||||
# against are missing, this can happen if we try to run electron
|
# NOTE: Linux does not let an app run if some of the libs it is dynamically
|
||||||
# on a non-GUI box...
|
# linked against are missing, this can happen if we try to run electron
|
||||||
|
# on a non-GUI box (i.e. no gtk)...
|
||||||
# ...love the "statically" linked "dynamic" libs...
|
# ...love the "statically" linked "dynamic" libs...
|
||||||
ELECTRON_VERSION := $(strip $(shell electron -v))
|
ELECTRON_VERSION_FALLBACK = v1.8.1
|
||||||
ELECTRON_VERSION ?= v1.8.1
|
ELECTRON_VERSION := $(strip $(shell electron -v || echo $(ELECTRON_VERSION_FALLBACK)))
|
||||||
ELECTRON_DOWNOAD_URL = https://github.com/electron/electron/releases/download
|
ELECTRON_DOWNOAD_URL ?= https://github.com/electron/electron/releases/download
|
||||||
|
|
||||||
|
|
||||||
# OS-specific stuff...
|
# OS-specific stuff...
|
||||||
@ -61,34 +62,37 @@ endif
|
|||||||
#----------------------------------------------------------------------
|
#----------------------------------------------------------------------
|
||||||
# Built-in make stuff...
|
# Built-in make stuff...
|
||||||
|
|
||||||
|
# NOTE: some of the targets are directories so this will enable GNUMake's
|
||||||
|
# automatic cleanup to work.
|
||||||
|
# ...not sure if this is the right way to go...
|
||||||
RM += -f
|
RM += -f
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#**********************************************************************
|
#**********************************************************************
|
||||||
|
|
||||||
TARGET_DIR=targets
|
TARGET_DIR = targets
|
||||||
NODE_DIR=node_modules
|
BUILD_DIR = build
|
||||||
BUILD_DIR=build
|
DIST_DIR = dist
|
||||||
DIST_DIR=dist
|
|
||||||
|
|
||||||
LIB_DIR=lib
|
NODE_DIR = node_modules
|
||||||
EXT_LIB_DIR=ext-lib
|
LIB_DIR = lib
|
||||||
CSS_DIR=css
|
EXT_LIB_DIR = ext-lib
|
||||||
CFG_DIR=cfg
|
CSS_DIR = css
|
||||||
DOMAIN_DIR=imagegrid
|
CFG_DIR = cfg
|
||||||
FEATURES_DIR=features
|
DOMAIN_DIR = imagegrid
|
||||||
WORKERS_DIR=workers
|
FEATURES_DIR = features
|
||||||
IMAGES_DIR=images
|
WORKERS_DIR = workers
|
||||||
|
IMAGES_DIR = images
|
||||||
|
|
||||||
PROJECT_FILES = package.json
|
PROJECT_FILES = package.json
|
||||||
# get all the .less files to process...
|
# get all .css build targets, in addition, get all the .less files and
|
||||||
#LESS_FILES := $(shell find . -type f -name '*.less')
|
# replace .less with .css making them build targets...
|
||||||
CSS_FILES := $(patsubst %.less,%.css,$(wildcard css/*.less))
|
CSS_FILES := $(patsubst %.less,%.css,$(wildcard css/*.less))
|
||||||
JS_FILES := $(wildcard *.js)
|
JS_FILES := $(wildcard *.js)
|
||||||
HTML_FILES := $(wildcard *.html)
|
HTML_FILES := $(wildcard *.html)
|
||||||
|
|
||||||
APP_DATE=$(BUILD_DIR)/DATE
|
APP_DATE = $(BUILD_DIR)/DATE
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -97,18 +101,21 @@ APP_DATE=$(BUILD_DIR)/DATE
|
|||||||
|
|
||||||
all: dev
|
all: dev
|
||||||
|
|
||||||
|
|
||||||
.PHONY: all css dev clean cleanall dist \
|
.PHONY: all css dev clean cleanall dist \
|
||||||
electron-dist-x64 electron-dist-ia32
|
electron-dist-x64 electron-dist-ia32
|
||||||
|
|
||||||
|
|
||||||
css: $(CSS_FILES)
|
css: $(CSS_FILES)
|
||||||
|
|
||||||
|
|
||||||
dev: $(NODE_DIR) css
|
dev: $(NODE_DIR) css
|
||||||
|
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
$(RM) $(BUILD_DIR)
|
$(RM) $(BUILD_DIR)
|
||||||
|
|
||||||
# XXX for some reason this is called on make win64e...
|
|
||||||
cleanall: clean
|
cleanall: clean
|
||||||
$(RM) $(DIST_DIR) $(TARGET_DIR)
|
$(RM) $(DIST_DIR) $(TARGET_DIR)
|
||||||
|
|
||||||
@ -116,6 +123,7 @@ cleanall: clean
|
|||||||
electron-dist-x64: $(DIST_DIR)/$(APP_NAME)-$(TARGET_OS)-x64.zip
|
electron-dist-x64: $(DIST_DIR)/$(APP_NAME)-$(TARGET_OS)-x64.zip
|
||||||
electron-inst-x64: $(DIST_DIR)/$(APP_NAME)-$(TARGET_OS)-x64.msi
|
electron-inst-x64: $(DIST_DIR)/$(APP_NAME)-$(TARGET_OS)-x64.msi
|
||||||
|
|
||||||
|
|
||||||
electron-dist-ia32: $(DIST_DIR)/$(APP_NAME)-$(TARGET_OS)-ia32.zip
|
electron-dist-ia32: $(DIST_DIR)/$(APP_NAME)-$(TARGET_OS)-ia32.zip
|
||||||
electron-inst-ia32: $(DIST_DIR)/$(APP_NAME)-$(TARGET_OS)-ia32.msi
|
electron-inst-ia32: $(DIST_DIR)/$(APP_NAME)-$(TARGET_OS)-ia32.msi
|
||||||
|
|
||||||
@ -136,16 +144,15 @@ $(APP_DATE): $(CSS_FILES) $(NODE_DIR) $(PROJECT_FILES) \
|
|||||||
date "+%Y%m%d %H%M" > $(APP_DATE)
|
date "+%Y%m%d %H%M" > $(APP_DATE)
|
||||||
|
|
||||||
|
|
||||||
|
%.css: %.less
|
||||||
|
lessc $< > $@
|
||||||
|
|
||||||
|
|
||||||
# XXX need to make this arch/os specific for cross compiling...
|
# XXX need to make this arch/os specific for cross compiling...
|
||||||
$(NODE_DIR):
|
$(NODE_DIR):
|
||||||
npm install
|
npm install
|
||||||
|
|
||||||
|
|
||||||
# process LESS files to CSS...
|
|
||||||
%.css: %.less
|
|
||||||
lessc $< > $@
|
|
||||||
|
|
||||||
|
|
||||||
# build app dir...
|
# build app dir...
|
||||||
# XXX need to make this arch/os specific (see: $(NODE_DIR) rule)...
|
# XXX need to make this arch/os specific (see: $(NODE_DIR) rule)...
|
||||||
# XXX make junction to $(NODE_DIR) -- does not work with asar
|
# XXX make junction to $(NODE_DIR) -- does not work with asar
|
||||||
@ -208,7 +215,7 @@ $(DIST_DIR)/$(APP_NAME)-%.zip: $(BUILD_DIR)/$(APP_NAME)-%
|
|||||||
|
|
||||||
|
|
||||||
# installer (WiX)...
|
# installer (WiX)...
|
||||||
# XXX add to path...
|
# XXX add tools to path...
|
||||||
|
|
||||||
# harvest directory tree...
|
# harvest directory tree...
|
||||||
%.wxs:
|
%.wxs:
|
||||||
@ -226,10 +233,6 @@ $(DIST_DIR)/$(APP_NAME)-%.msi: $(BUILD_DIR)/$(APP_NAME)-% $(BUILD_DIR)/$(APP_NAM
|
|||||||
@mkdir -p "$(@D)"
|
@mkdir -p "$(@D)"
|
||||||
|
|
||||||
|
|
||||||
# XXX OSX
|
|
||||||
# XXX android...
|
|
||||||
# XXX iOS...
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#**********************************************************************
|
#**********************************************************************
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user