forked from cory/tildefriends
		
	build: Rename the macosdebug/macosrelease targets to debug/release. #101
This commit is contained in:
		
							
								
								
									
										63
									
								
								GNUmakefile
									
									
									
									
									
								
							
							
						
						
									
										63
									
								
								GNUmakefile
									
									
									
									
									
								
							@@ -41,7 +41,7 @@ export SOURCE_DATE_EPOCH=1
 | 
			
		||||
export TZ=UTC
 | 
			
		||||
 | 
			
		||||
ifeq ($(UNAME_S),Darwin)
 | 
			
		||||
BUILD_TYPES := macosdebug macosrelease iosdebug iosrelease iossimdebug iossimrelease
 | 
			
		||||
BUILD_TYPES := debug release iosdebug iosrelease iossimdebug iossimrelease
 | 
			
		||||
else ifeq ($(UNAME_S),Linux)
 | 
			
		||||
BUILD_TYPES := debug release
 | 
			
		||||
HAVE_ANDROID = $(if $(shell which $(ANDROID_SDK)/platform-tools/adb),1)
 | 
			
		||||
@@ -140,12 +140,16 @@ ifeq ($(HAVE_CROSS_AARCH64),1)
 | 
			
		||||
BUILD_TYPES += armdebug armrelease
 | 
			
		||||
endif
 | 
			
		||||
 | 
			
		||||
LINUX_TARGETS := \
 | 
			
		||||
HOST_TARGETS := \
 | 
			
		||||
	out/debug/tildefriends \
 | 
			
		||||
	out/release/tildefriends
 | 
			
		||||
ifeq ($(UNAME_S),Darwin)
 | 
			
		||||
MACOS_TARGETS := \
 | 
			
		||||
	out/macosdebug/tildefriends \
 | 
			
		||||
	out/macosrelease/tildefriends
 | 
			
		||||
	out/debug/tildefriends \
 | 
			
		||||
	out/release/tildefriends
 | 
			
		||||
else
 | 
			
		||||
MACOS_TARGETS :=
 | 
			
		||||
endif
 | 
			
		||||
IOS_TARGETS := \
 | 
			
		||||
	out/iosdebug/tildefriends \
 | 
			
		||||
	out/iosrelease/tildefriends
 | 
			
		||||
@@ -173,7 +177,6 @@ DEBUG_TARGETS := \
 | 
			
		||||
	out/windebug/tildefriends.exe \
 | 
			
		||||
	out/iosdebug/tildefriends \
 | 
			
		||||
	out/iossimdebug/tildefriends \
 | 
			
		||||
	out/macosdebug/tildefriends \
 | 
			
		||||
	out/androiddebug/tildefriends \
 | 
			
		||||
	out/androiddebug-armv7a/tildefriends \
 | 
			
		||||
	out/androiddebug-x86_64/tildefriends \
 | 
			
		||||
@@ -184,7 +187,6 @@ RELEASE_TARGETS := \
 | 
			
		||||
	out/winrelease/tildefriends.exe \
 | 
			
		||||
	out/iosrelease/tildefriends \
 | 
			
		||||
	out/iossimrelease/tildefriends \
 | 
			
		||||
	out/macosrelease/tildefriends \
 | 
			
		||||
	out/androidrelease/tildefriends \
 | 
			
		||||
	out/androidrelease-armv7a/tildefriends \
 | 
			
		||||
	out/androidrelease-x86_64/tildefriends \
 | 
			
		||||
@@ -235,7 +237,7 @@ $(AARCH64_TARGETS): AS = $(CC)
 | 
			
		||||
$(AARCH64_TARGETS): CFLAGS += -Ideps/openssl/Linux/aarch64/usr/local/include
 | 
			
		||||
$(AARCH64_TARGETS): LDFLAGS += -Ldeps/openssl/Linux/aarch64/usr/local/lib
 | 
			
		||||
ifeq ($(UNAME_S),Darwin)
 | 
			
		||||
$(MACOS_TARGETS): CC = xcrun clang
 | 
			
		||||
$(HOST_TARGETS): CC = xcrun clang
 | 
			
		||||
$(IOS_TARGETS): IOS_SYSROOT := $(shell xcrun --sdk iphoneos --show-sdk-path)
 | 
			
		||||
$(IOS_TARGETS): CC = xcrun --sdk iphoneos clang -isysroot $(IOS_SYSROOT) -arch arm64
 | 
			
		||||
$(IOSSIM_TARGETS): IOSSIM_SYSROOT := $(shell xcrun --sdk iphonesimulator --show-sdk-path)
 | 
			
		||||
@@ -276,8 +278,8 @@ $(IOS_TARGETS): LDFLAGS += -Ldeps/openssl/$(UNAME_S)/ios64-cross/usr/local/lib
 | 
			
		||||
endif
 | 
			
		||||
$(IOSSIM_TARGETS): CFLAGS += -Ideps/openssl/ios/iossimulator-xcrun/usr/local/include
 | 
			
		||||
$(IOSSIM_TARGETS): LDFLAGS += -Ldeps/openssl/ios/iossimulator-xcrun/usr/local/lib
 | 
			
		||||
$(LINUX_TARGETS) $(MACOS_TARGETS): CFLAGS += -Ideps/openssl/$(UNAME_S)/$(UNAME_M)/usr/local/include
 | 
			
		||||
$(LINUX_TARGETS) $(MACOS_TARGETS): LDFLAGS += -Ldeps/openssl/$(UNAME_S)/$(UNAME_M)/usr/local/lib
 | 
			
		||||
$(HOST_TARGETS): CFLAGS += -Ideps/openssl/$(UNAME_S)/$(UNAME_M)/usr/local/include
 | 
			
		||||
$(HOST_TARGETS): LDFLAGS += -Ldeps/openssl/$(UNAME_S)/$(UNAME_M)/usr/local/lib
 | 
			
		||||
 | 
			
		||||
ifeq ($(UNAME_M),x86_64)
 | 
			
		||||
ifeq ($(UNAME_S),Linux)
 | 
			
		||||
@@ -296,14 +298,19 @@ endif
 | 
			
		||||
 | 
			
		||||
get_objs = \
 | 
			
		||||
	$(foreach build_type,$(BUILD_TYPES),$(addprefix $(BUILD_DIR)/$(build_type)/,$(addsuffix .o,$(basename $(value $(1)))))) \
 | 
			
		||||
	$(foreach build_type,debug release armdebug armrelease,$(addprefix $(BUILD_DIR)/$(build_type)/,$(addsuffix .o,$(basename $(value $(1)_unix))))) \
 | 
			
		||||
	$(foreach build_type,windebug winrelease,$(addprefix $(BUILD_DIR)/$(build_type)/,$(addsuffix .o,$(basename $(value $(1)_win))))) \
 | 
			
		||||
	$(foreach build_type,androiddebug androidrelease androiddebug-x86 androidrelease-x86 androiddebug-x86_64 androidrelease-x86_64 androiddebug-armv7a androiddebug-armv7a,$(addprefix $(BUILD_DIR)/$(build_type)/,$(addsuffix .o,$(basename $(value $(1)_android))))) \
 | 
			
		||||
	$(foreach build_type,androiddebug androidrelease androiddebug-x86 androidrelease-x86 androiddebug-x86_64 androidrelease-x86_64 androiddebug-armv7a androidrelease-armv7a,$(addprefix $(BUILD_DIR)/$(build_type)/,$(addsuffix .o,$(basename $(value $(1)_unix))))) \
 | 
			
		||||
	$(foreach build_type,macosdebug macosrelease iosdebug iosrelease iossimdebug iossimrelease,$(addprefix $(BUILD_DIR)/$(build_type)/,$(addsuffix .o,$(basename $(value $(1)_macos))))) \
 | 
			
		||||
	$(foreach build_type,iosdebug iosrelease iossimdebug iossimrelease,$(addprefix $(BUILD_DIR)/$(build_type)/,$(addsuffix .o,$(basename $(value $(1)_ios))))) \
 | 
			
		||||
	$(foreach build_type,androiddebug-x86 androidrelease-x86,$(addprefix $(BUILD_DIR)/$(build_type)/,$(addsuffix .o,$(basename $(value $(1)_x86)))))
 | 
			
		||||
 | 
			
		||||
ifeq ($(UNAME_S),Darwin)
 | 
			
		||||
get_objs += \
 | 
			
		||||
	$(foreach build_type,debug release iosdebug iosrelease iossimdebug iossimrelease,$(addprefix $(BUILD_DIR)/$(build_type)/,$(addsuffix .o,$(basename $(value $(1)_macos)))))
 | 
			
		||||
else
 | 
			
		||||
get_objs += \
 | 
			
		||||
	$(foreach build_type,debug release armdebug armrelease,$(addprefix $(BUILD_DIR)/$(build_type)/,$(addsuffix .o,$(basename $(value $(1)_unix)))))
 | 
			
		||||
endif
 | 
			
		||||
 | 
			
		||||
APP_SOURCES := $(wildcard src/*.c)
 | 
			
		||||
APP_SOURCES_ios := $(wildcard src/*.m)
 | 
			
		||||
APP_OBJS := $(call get_objs,APP_SOURCES)
 | 
			
		||||
@@ -324,10 +331,12 @@ $(APP_OBJS): CFLAGS += \
 | 
			
		||||
	-Ideps/valgrind \
 | 
			
		||||
	-Wdouble-promotion \
 | 
			
		||||
	-Werror
 | 
			
		||||
ifneq ($(UNAME_S),Darwin)
 | 
			
		||||
ifeq ($(UNAME_M),x86_64)
 | 
			
		||||
$(filter-out $(BUILD_DIR)/android% $(BUILD_DIR)/macos% $(BUILD_DIR)/ios%,$(APP_OBJS)): CFLAGS += \
 | 
			
		||||
$(filter-out $(BUILD_DIR)/android% $(BUILD_DIR)/ios%,$(APP_OBJS)): CFLAGS += \
 | 
			
		||||
	-fanalyzer
 | 
			
		||||
endif
 | 
			
		||||
endif
 | 
			
		||||
 | 
			
		||||
ARES_SOURCES := \
 | 
			
		||||
	deps/c-ares/src/lib/ares_addrinfo2hostent.c \
 | 
			
		||||
@@ -760,12 +769,12 @@ $(MINIUNZIP_OBJS): CFLAGS += \
 | 
			
		||||
LDFLAGS += \
 | 
			
		||||
	-pthread \
 | 
			
		||||
	-lm
 | 
			
		||||
$(LINUX_TARGETS) $(MACOS_TARGETS) $(IOS_TARGETS) $(IOSSIM_TARGETS) $(AARCH64_TARGETS): LDFLAGS += \
 | 
			
		||||
$(HOST_TARGETS) $(IOS_TARGETS) $(IOSSIM_TARGETS) $(AARCH64_TARGETS): LDFLAGS += \
 | 
			
		||||
	-lssl \
 | 
			
		||||
	-lcrypto
 | 
			
		||||
ifneq ($(UNAME_S),Haiku)
 | 
			
		||||
ifneq ($(UNAME_S),OpenBSD)
 | 
			
		||||
debug release $(MACOS_TARGETS) $(IOS_TARGETS) $(IOSSIM_TARGETS): LDFLAGS += \
 | 
			
		||||
$(HOST_TARGETS) $(IOS_TARGETS) $(IOSSIM_TARGETS): LDFLAGS += \
 | 
			
		||||
	-ldl
 | 
			
		||||
endif
 | 
			
		||||
endif
 | 
			
		||||
@@ -798,27 +807,15 @@ $(IOS_TARGETS) $(IOSSIM_TARGETS): LDFLAGS += \
 | 
			
		||||
##
 | 
			
		||||
## Common targets:
 | 
			
		||||
##
 | 
			
		||||
debug: ## Build a debug executable for the current platform.
 | 
			
		||||
release: ## Build a release executable for the current platform.
 | 
			
		||||
all: $(BUILD_TYPES) ## Build all targets that appear possible to build on this machine.
 | 
			
		||||
debug: ## Build a debug executable for the current host platform.
 | 
			
		||||
release: ## Build a release executable for the current host platform.
 | 
			
		||||
armdebug: ## Cross-compile aarch64 debug on Linux.
 | 
			
		||||
armrelease: ## Cross-compile aarch64 release on Linux.
 | 
			
		||||
all: $(BUILD_TYPES) ## Build all targets that appear possible to build on this machine.
 | 
			
		||||
unix: debug release ## Build all UNIX targets.
 | 
			
		||||
win: windebug winrelease ## Build all Windows targets.
 | 
			
		||||
windebug: ## Cross-compile a debug win32 executable on Linux.
 | 
			
		||||
winrelease: ## Cross-compile a release win32 executable on Linux.
 | 
			
		||||
.PHONY: all win unix
 | 
			
		||||
 | 
			
		||||
##
 | 
			
		||||
## Windows targets:
 | 
			
		||||
##
 | 
			
		||||
windebug: ## Build a debug win32 executable.
 | 
			
		||||
winrelease: ## Build a release win32 executable.
 | 
			
		||||
 | 
			
		||||
##
 | 
			
		||||
## MacOS targets:
 | 
			
		||||
##
 | 
			
		||||
macosdebug: ## Build a MacOS debug executable.
 | 
			
		||||
macosrelease: ## Build a MacOS release executable.
 | 
			
		||||
 | 
			
		||||
ALL_APP_OBJS := \
 | 
			
		||||
	$(APP_OBJS) \
 | 
			
		||||
	$(ARES_OBJS) \
 | 
			
		||||
@@ -1184,7 +1181,7 @@ ifeq ($(UNAME_S),Darwin)
 | 
			
		||||
LOCAL_DEPS := deps/openssl/$(UNAME_S)/$(UNAME_M)/usr/local/lib/libssl.a
 | 
			
		||||
$(LOCAL_DEPS):
 | 
			
		||||
	+@tools/ssl-local
 | 
			
		||||
$(filter $(BUILD_DIR)/macosdebug/%,$(APP_OBJS)) $(filter $(BUILD_DIR)/macosrelease/%,$(APP_OBJS)): | $(LOCAL_DEPS)
 | 
			
		||||
$(filter $(BUILD_DIR)/debug/%,$(APP_OBJS)) $(filter $(BUILD_DIR)/release/%,$(APP_OBJS)): | $(LOCAL_DEPS)
 | 
			
		||||
endif
 | 
			
		||||
 | 
			
		||||
ifeq ($(HAVE_WIN),1)
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user