now makefile detects arch...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2018-01-09 03:28:06 +03:00
parent 25dbde80ad
commit 48d489686f

View File

@ -22,7 +22,9 @@
# - installers: # - installers:
# - msi # - msi
# - deb # - deb
# - ...
# - cross-compiling support... # - cross-compiling support...
# - upstream clean build: git clone -> make dist
# #
# #
# #
@ -47,15 +49,37 @@ ELECTRON_DOWNOAD_URL ?= https://github.com/electron/electron/releases/download
ifeq ($(OS),Windows_NT) ifeq ($(OS),Windows_NT)
EXT = .exe EXT = .exe
DLLs = "$@/"*dll DLLs = "$@/"*dll
# NOTE: this is electron naming convention...
TARGET_OS = win32 TARGET_OS = win32
# set arch...
ifeq ($(PROCESSOR_ARCHITEW6432),AMD64)
ARCH ?= x64
else
ifeq ($(PROCESSOR_ARCHITECTURE),AMD64)
ARCH ?= x64
endif
ifeq ($(PROCESSOR_ARCHITECTURE),x86)
ARCH ?= ia32
endif
endif
else else
ifeq ($(shell uname -s),Linux) ifeq ($(shell uname -s),Linux)
TARGET_OS = linux TARGET_OS = linux
ARCH ?= x64
endif endif
ifeq ($(shell uname -s),Darwin) ifeq ($(shell uname -s),Darwin)
TARGET_OS = darwin TARGET_OS = darwin
endif endif
# set arch...
ifeq ($(shell uname -p),x86_64)
ARCH ?= x64
endif
ifneq ($(filter %86,$(shell uname -p)),)
ARCH ?= ia32
endif
endif endif
@ -70,6 +94,7 @@ RM += -f
#********************************************************************** #**********************************************************************
# Paths and lists...
TARGET_DIR = targets TARGET_DIR = targets
BUILD_DIR = build BUILD_DIR = build
@ -85,14 +110,13 @@ FEATURES_DIR = features
WORKERS_DIR = workers WORKERS_DIR = workers
IMAGES_DIR = images IMAGES_DIR = images
APP_DATE = $(BUILD_DIR)/DATE
PROJECT_FILES = package.json PROJECT_FILES = package.json
# get all .css build targets, in addition, get all the .less files and # get all .css build targets, in addition, get all the .less files and
# replace .less with .css making them build targets... # 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)
HTML_FILES := $(wildcard *.html) HTML_FILES := $(wildcard *.html)
JS_FILES := $(wildcard *.js)
APP_DATE = $(BUILD_DIR)/DATE
@ -120,15 +144,11 @@ cleanall: clean
$(RM) $(DIST_DIR) $(TARGET_DIR) $(RM) $(DIST_DIR) $(TARGET_DIR)
electron-dist-x64: $(DIST_DIR)/$(APP_NAME)-$(TARGET_OS)-x64.zip electron-dist: $(DIST_DIR)/$(APP_NAME)-$(TARGET_OS)-$(ARCH).zip
electron-inst-x64: $(DIST_DIR)/$(APP_NAME)-$(TARGET_OS)-x64.msi electron-inst: $(DIST_DIR)/$(APP_NAME)-$(TARGET_OS)-$(ARCH).msi
electron-dist-ia32: $(DIST_DIR)/$(APP_NAME)-$(TARGET_OS)-ia32.zip dist: electron-dist
electron-inst-ia32: $(DIST_DIR)/$(APP_NAME)-$(TARGET_OS)-ia32.msi
dist: electron-dist-x64
@ -180,8 +200,7 @@ $(BUILD_DIR)/app.asar: $(BUILD_DIR)/$(APP_NAME)
asar p "$(APP_NAME)" app.asar asar p "$(APP_NAME)" app.asar
# get the electron binary... # get the electron binary (keep this cached)...
# XXX for some odd reason this is deleted adter extraction...
.PRECIOUS: $(TARGET_DIR)/electron-$(ELECTRON_VERSION)-%.zip .PRECIOUS: $(TARGET_DIR)/electron-$(ELECTRON_VERSION)-%.zip
$(TARGET_DIR)/electron-$(ELECTRON_VERSION)-%.zip: $(TARGET_DIR)/electron-$(ELECTRON_VERSION)-%.zip:
@mkdir -p $(@D) @mkdir -p $(@D)
@ -190,8 +209,7 @@ $(TARGET_DIR)/electron-$(ELECTRON_VERSION)-%.zip:
-O "$@" -O "$@"
# build the app dir... # build the app dir (electron-specific)...
# XXX this is electron-specific...
.PRECIOUS: $(BUILD_DIR)/$(APP_NAME)-% .PRECIOUS: $(BUILD_DIR)/$(APP_NAME)-%
$(BUILD_DIR)/$(APP_NAME)-%: $(TARGET_DIR)/electron-$(ELECTRON_VERSION)-%.zip \ $(BUILD_DIR)/$(APP_NAME)-%: $(TARGET_DIR)/electron-$(ELECTRON_VERSION)-%.zip \
$(BUILD_DIR)/app.asar $(APP_DATE) $(BUILD_DIR)/app.asar $(APP_DATE)