forked from ni-webtech/appweb-4
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
107 lines (96 loc) · 4.63 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
#
# Makefile - Embedthis Appweb Makefile wrapper for per-platform makefiles
#
# This Makefile is for Unix/Linux and Cygwin. On windows, it can be invoked via make.bat.
#
# You can use this Makefile and build via "make" with a pre-selected configuration. Alternatively,
# you can build using the MakeMe tool for for a fully configurable build. If you wish to
# cross-compile, you should use MakeMe.
#
# See projects/$(OS)-$(ARCH)-$(PROFILE)-me.h for configuration default settings. Can override
# via make environment variables. For example: make ME_COM_SQLITE=0. These are converted to
# DFLAGS and will then override the me.h default values. Use "make help" for a list of available
# make variable options.
#
NAME := appweb
OS := $(shell uname | sed 's/CYGWIN.*/windows/;s/Darwin/macosx/' | tr '[A-Z]' '[a-z]')
PROFILE := default
ifeq ($(ARCH),)
ifeq ($(OS),windows)
ifeq ($(PROCESSOR_ARCHITEW6432),AMD64)
ARCH?=x64
else
ARCH?=x86
endif
else
ARCH:= $(shell uname -m | sed 's/i.86/x86/;s/x86_64/x64/;s/arm.*/arm/;s/mips.*/mips/')
endif
endif
ifeq ($(OS),windows)
MAKE := MAKEFLAGS= projects/windows.bat $(ARCH) nmake -nologo
EXT := nmake
else
MAKE := $(shell if which gmake >/dev/null 2>&1; then echo gmake ; else echo make ; fi) --no-print-directory
EXT := mk
endif
BIN := $(OS)-$(ARCH)-$(PROFILE)/bin
PATH := $(BIN):$(PATH)
.EXPORT_ALL_VARIABLES:
all compile:
@if [ ! -f projects/$(NAME)-$(OS)-$(PROFILE).$(EXT) ] ; then \
echo "The build configuration projects/$(NAME)-$(OS)-$(PROFILE).$(EXT) is not supported" ; exit 255 ; \
fi
@echo ' [Run] $(MAKE) -f projects/$(NAME)-$(OS)-$(PROFILE).$(EXT) $@'
@$(MAKE) -f projects/$(NAME)-$(OS)-$(PROFILE).$(EXT) $@
@echo ' [Info] Run via: "make run". Run manually with "build/$(OS)-$(ARCH)-$(PROFILE)/bin" in your path.'
@echo ""
clean clobber install installBinary uninstall run:
@echo ' [Run] $(MAKE) -f projects/$(NAME)-$(OS)-$(PROFILE).$(EXT) $@'
@$(MAKE) -f projects/$(NAME)-$(OS)-$(PROFILE).$(EXT) $@
@echo ' [Info] $@ complete'
deploy:
@echo ' [Deploy] $(MAKE) ME_ROOT_PREFIX=$(OS)-$(ARCH)-$(PROFILE)/deploy -f projects/$(NAME)-$(OS)-$(PROFILE).$(EXT) installBinary'
@$(MAKE) ME_ROOT_PREFIX=$(OS)-$(ARCH)-$(PROFILE)/deploy -f projects/$(NAME)-$(OS)-$(PROFILE).$(EXT) installBinary
version:
@$(MAKE) -f projects/$(NAME)-$(OS)-$(PROFILE).$(EXT) $@
help:
@echo '' >&2
@echo 'usage: make [clean, compile, deploy, install, run, uninstall]' >&2
@echo '' >&2
@echo 'The default configuration can be modified by setting make variables' >&2
@echo 'Set to 0 to disable and 1 to enable:' >&2
@echo '' >&2
@echo ' ME_ESP_MDB # Enable ESP MDB database support' >&2
@echo ' ME_ESP_SDB # Enable ESP SQLite database support' >&2
@echo ' ME_MPR_LOGGING # Enable application logging' >&2
@echo ' ME_MPR_TRACING # Enable debug tracing' >&2
@echo ' ME_COM_CGI # Enable the CGI handler' >&2
@echo ' ME_COM_DIR # Enable the directory listing handler' >&2
@echo ' ME_COM_ESP # Enable the ESP web framework' >&2
@echo ' ME_COM_MBEDTLS # Enable the mbed TLS stack' >&2
@echo ' ME_COM_OPENSSL # Enable the OpenSSL SSL stack' >&2
@echo ' ME_COM_SQLITE # Enable the SQLite database' >&2
@echo ' ME_ROM # Build for ROM without a file system' >&2
@echo ' ME_STACK_SIZE # Define the VxWorks stack size' >&2
@echo '' >&2
@echo 'For example, to disable CGI:' >&2
@echo '' >&2
@echo ' ME_COM_CGI=0 make' >&2
@echo '' >&2
@echo 'Other make environment variables:' >&2
@echo ' ARCH # CPU architecture (x86, x64, ppc, ...)' >&2
@echo ' OS # Operating system (linux, macosx, windows, vxworks, ...)' >&2
@echo ' CC # Compiler to use ' >&2
@echo ' LD # Linker to use' >&2
@echo ' CONFIG # Output directory for built items. Defaults to OS-ARCH-PROFILE' >&2
@echo ' CFLAGS # Add compiler options. For example: -Wall' >&2
@echo ' DEBUG # Set to "debug" for symbols, "release" for optimized builds' >&2
@echo ' DFLAGS # Add compiler defines. For example: -DCOLOR=blue' >&2
@echo ' IFLAGS # Add compiler include directories. For example: -I/extra/includes' >&2
@echo ' LDFLAGS # Add linker options' >&2
@echo ' LIBPATHS # Add linker library search directories. For example: -L/libraries' >&2
@echo ' LIBS # Add linker libraries. For example: -lpthreads' >&2
@echo ' PROFILE # Set to "static" for static linking or "default" for dynamic' >&2
@echo '' >&2
@echo 'Use "SHOW=1 make" to show executed commands.' >&2
@echo '' >&2