makefile tweaks for linux/osx

This commit is contained in:
Joseph Henry
2016-06-29 12:07:28 -07:00
parent 3c3ef79c6e
commit c40d35715c
2 changed files with 19 additions and 36 deletions

View File

@@ -1,22 +1,11 @@
#
# Makefile for ZeroTier One on Linux
#
# This is confirmed to work on distributions newer than CentOS 6 (the
# one used for reference builds) and on 32 and 64 bit x86 and ARM
# machines. It should also work on other 'normal' machines and recent
# distributions. Editing might be required for tiny devices or weird
# distros.
# Makefile for ZeroTier SDK on Linux
#
# Targets
# one: zerotier-one and symlinks (cli and idtool)
# doc: builds manpages, requires rst2man somewhere in PATH
# all: builds 'one'
# selftest: zerotier-selftest
# debug: builds 'one' and 'selftest' with tracing and debug flags
# installer: builds installers and packages (RPM/DEB/etc.) if possible
# official: cleans and then builds 'one', 'installer', and 'doc'
# all: build every target possible on host system, plus tests
# check: reports OK/FAIL of built targets
# tests: build only test applications for host system
# clean: removes all built files, objects, other trash
#
GENERATED_FILES :=
DOC_DIR = doc
@@ -57,22 +46,17 @@ else
STRIP+=--strip-all
endif
# Debug output for ZeroTier service
ifeq ($(ZT_TRACE),1)
DEFS+=-DZT_TRACE
endif
# Debug output for Network Containers
# Specific levels can be controlled in netcon/common.inc.c
# Debug output for the SDK
# Specific levels can be controlled in src/SDK_Debug.h
ifeq ($(SDK_DEBUG),1)
DEFS+=-DSDK_DEBUG -g
endif
# Uncomment for gprof profile build
#CFLAGS=-Wall -g -pg -pthread $(INCLUDES) $(DEFS)
#CXXFLAGS=-Wall -g -pg -pthread $(INCLUDES) $(DEFS)
#LDFLAGS=
#STRIP=echo
all: shared_lib check
remove_only_intermediates:

View File

@@ -1,3 +1,12 @@
#
# Makefile for ZeroTier SDK on OSX
#
# Targets
# all: build every target possible on host system, plus tests
# check: reports OK/FAIL of built targets
# tests: build only test applications for host system
# clean: removes all built files, objects, other trash
ifeq ($(origin CC),default)
CC=$(shell if [ -e /usr/bin/clang ]; then echo clang; else echo gcc; fi)
endif
@@ -18,17 +27,7 @@ PRODUCTSIGN=echo
CODESIGN_APP_CERT=
CODESIGN_INSTALLER_CERT=
# For internal use only -- signs everything with ZeroTier's developer cert
ifeq ($(ZT_OFFICIAL_RELEASE),1)
DEFS+=-DZT_OFFICIAL_RELEASE -DZT_AUTO_UPDATE
ZT_USE_MINIUPNPC=1
CODESIGN=codesign
PRODUCTSIGN=productsign
CODESIGN_APP_CERT="Developer ID Application: ZeroTier Networks LLC (8ZD9JUCZ4V)"
CODESIGN_INSTALLER_CERT="Developer ID Installer: ZeroTier Networks LLC (8ZD9JUCZ4V)"
endif
# Debug mode -- dump trace output, build binary with -g
# Debug output for ZeroTier service
ifeq ($(ZT_DEBUG),1)
DEFS+=-DZT_TRACE
CFLAGS+=-Wall -g -pthread $(INCLUDES) $(DEFS)
@@ -42,8 +41,8 @@ else
STRIP=strip
endif
# Debug output for SDK
# Specific levels can be controlled in src/debug.h
# Debug output for the SDK
# Specific levels can be controlled in src/SDK_Debug.h
ifeq ($(SDK_DEBUG),1)
DEFS+=-DSDK_DEBUG -g
endif