From cec757cac4b310c403a2d9e01132e96c228181f4 Mon Sep 17 00:00:00 2001 From: jakcron Date: Wed, 13 Apr 2022 15:11:34 +0800 Subject: [PATCH] Update MakeROM makefiles. --- makerom/deps/libpolarssl/makefile | 34 +++++++++++++++---------------- makerom/deps/libyaml/makefile | 33 +++++++++++++++--------------- makerom/makefile | 13 +++--------- 3 files changed, 37 insertions(+), 43 deletions(-) diff --git a/makerom/deps/libpolarssl/makefile b/makerom/deps/libpolarssl/makefile index 43aa82f..446c3ed 100644 --- a/makerom/deps/libpolarssl/makefile +++ b/makerom/deps/libpolarssl/makefile @@ -1,10 +1,9 @@ # C++/C Recursive Project Makefile # (c) Jack -# Version 6 (20211110) +# Version 7 (20220413) # Project Name PROJECT_NAME = libpolarssl - # Project Relative Paths PROJECT_PATH = $(CURDIR) PROJECT_SRC_PATH = src @@ -23,13 +22,6 @@ ifeq ($(ROOT_PROJECT_NAME),) export ROOT_PROJECT_DEPENDENCY_PATH = $(ROOT_PROJECT_PATH)/deps endif -# Shared Library Definitions -PROJECT_SO_VER_MAJOR = 0 -PROJECT_SO_VER_MINOR = 1 -PROJECT_SO_VER_PATCH = 0 -PROJECT_SONAME = $(PROJECT_NAME).so.$(PROJECT_SO_VER_MAJOR) -PROJECT_SO_FILENAME = $(PROJECT_SONAME).$(PROJECT_SO_VER_MINOR).$(PROJECT_SO_VER_PATCH) - # Project Dependencies PROJECT_DEPEND = PROJECT_DEPEND_LOCAL_DIR = @@ -58,6 +50,8 @@ ifeq ($(PROJECT_PLATFORM),) UNAME = $(shell uname -s) ifeq ($(UNAME), Darwin) export PROJECT_PLATFORM = MACOS + else ifneq (, $(findstring CYGWIN_NT, $(UNAME))) + export PROJECT_PLATFORM = CYGWIN_NT else export PROJECT_PLATFORM = GNU endif @@ -72,6 +66,8 @@ ifeq ($(PROJECT_PLATFORM_ARCH),) export PROJECT_PLATFORM_ARCH = $(shell uname -m) else ifeq ($(PROJECT_PLATFORM), MACOS) export PROJECT_PLATFORM_ARCH = $(shell uname -m) + else ifeq ($(PROJECT_PLATFORM), CYGWIN_NT) + export PROJECT_PLATFORM_ARCH = $(shell uname -m) else export PROJECT_PLATFORM_ARCH = x86_64 endif @@ -105,6 +101,15 @@ else ifeq ($(PROJECT_PLATFORM), MACOS) INC += LIB += ARFLAGS = rc +else ifeq ($(PROJECT_PLATFORM), CYGWIN_NT) + # CygWin Flags/Libs + #CC = + #CXX = + WARNFLAGS = -Wall -Wno-unused-value -Wno-unused-but-set-variable + ARCHFLAGS = + INC += + LIB += + ARFLAGS = cr -o endif # Compiler Flags @@ -116,11 +121,10 @@ SRC_OBJ = $(foreach dir,$(PROJECT_SRC_SUBDIRS),$(subst .cpp,.o,$(wildcard $(dir) TESTSRC_OBJ = $(foreach dir,$(PROJECT_TESTSRC_SUBDIRS),$(subst .cpp,.o,$(wildcard $(dir)/*.cpp))) $(foreach dir,$(PROJECT_TESTSRC_SUBDIRS),$(subst .cc,.o,$(wildcard $(dir)/*.cc))) $(foreach dir,$(PROJECT_TESTSRC_SUBDIRS),$(subst .c,.o,$(wildcard $(dir)/*.c))) # all is the default, user should specify what the default should do -# - 'static_lib' for building static library -# - 'shared_lib' for building shared library -# - 'program' for building the program +# - 'static_lib' for building source as a static library +# - 'program' for building source as executable program # - 'test_program' for building the test program -# These can typically be used together however *_lib and program should not be used together +# test_program can be used with program or static_lib, but program and static_lib cannot be used together all: static_lib clean: clean_object_files remove_binary_dir @@ -158,10 +162,6 @@ static_lib: $(SRC_OBJ) create_binary_dir @echo LINK $(PROJECT_BIN_PATH)/$(PROJECT_NAME).a @ar $(ARFLAGS) "$(PROJECT_BIN_PATH)/$(PROJECT_NAME).a" $(SRC_OBJ) -shared_lib: $(SRC_OBJ) create_binary_dir - @echo LINK $(PROJECT_BIN_PATH)/$(PROJECT_SO_FILENAME) - @gcc -shared -Wl,-soname,$(PROJECT_SONAME) -o "$(PROJECT_BIN_PATH)/$(PROJECT_SO_FILENAME)" $(SRC_OBJ) - # Build Program program: $(SRC_OBJ) create_binary_dir @echo LINK $(PROJECT_BIN_PATH)/$(PROJECT_NAME) diff --git a/makerom/deps/libyaml/makefile b/makerom/deps/libyaml/makefile index 5769138..443f427 100644 --- a/makerom/deps/libyaml/makefile +++ b/makerom/deps/libyaml/makefile @@ -1,6 +1,6 @@ # C++/C Recursive Project Makefile # (c) Jack -# Version 6 (20211110) +# Version 7 (20220413) # Project Name PROJECT_NAME = libyaml @@ -23,13 +23,6 @@ ifeq ($(ROOT_PROJECT_NAME),) export ROOT_PROJECT_DEPENDENCY_PATH = $(ROOT_PROJECT_PATH)/deps endif -# Shared Library Definitions -PROJECT_SO_VER_MAJOR = 0 -PROJECT_SO_VER_MINOR = 1 -PROJECT_SO_VER_PATCH = 0 -PROJECT_SONAME = $(PROJECT_NAME).so.$(PROJECT_SO_VER_MAJOR) -PROJECT_SO_FILENAME = $(PROJECT_SONAME).$(PROJECT_SO_VER_MINOR).$(PROJECT_SO_VER_PATCH) - # Project Dependencies PROJECT_DEPEND = PROJECT_DEPEND_LOCAL_DIR = @@ -58,6 +51,8 @@ ifeq ($(PROJECT_PLATFORM),) UNAME = $(shell uname -s) ifeq ($(UNAME), Darwin) export PROJECT_PLATFORM = MACOS + else ifneq (, $(findstring CYGWIN_NT, $(UNAME))) + export PROJECT_PLATFORM = CYGWIN_NT else export PROJECT_PLATFORM = GNU endif @@ -72,6 +67,8 @@ ifeq ($(PROJECT_PLATFORM_ARCH),) export PROJECT_PLATFORM_ARCH = $(shell uname -m) else ifeq ($(PROJECT_PLATFORM), MACOS) export PROJECT_PLATFORM_ARCH = $(shell uname -m) + else ifeq ($(PROJECT_PLATFORM), CYGWIN_NT) + export PROJECT_PLATFORM_ARCH = $(shell uname -m) else export PROJECT_PLATFORM_ARCH = x86_64 endif @@ -105,6 +102,15 @@ else ifeq ($(PROJECT_PLATFORM), MACOS) INC += LIB += ARFLAGS = rc +else ifeq ($(PROJECT_PLATFORM), CYGWIN_NT) + # CygWin Flags/Libs + #CC = + #CXX = + WARNFLAGS = -Wall -Wno-unused-value -Wno-unused-but-set-variable + ARCHFLAGS = + INC += + LIB += + ARFLAGS = cr -o endif # Compiler Flags @@ -116,11 +122,10 @@ SRC_OBJ = $(foreach dir,$(PROJECT_SRC_SUBDIRS),$(subst .cpp,.o,$(wildcard $(dir) TESTSRC_OBJ = $(foreach dir,$(PROJECT_TESTSRC_SUBDIRS),$(subst .cpp,.o,$(wildcard $(dir)/*.cpp))) $(foreach dir,$(PROJECT_TESTSRC_SUBDIRS),$(subst .cc,.o,$(wildcard $(dir)/*.cc))) $(foreach dir,$(PROJECT_TESTSRC_SUBDIRS),$(subst .c,.o,$(wildcard $(dir)/*.c))) # all is the default, user should specify what the default should do -# - 'static_lib' for building static library -# - 'shared_lib' for building shared library -# - 'program' for building the program +# - 'static_lib' for building source as a static library +# - 'program' for building source as executable program # - 'test_program' for building the test program -# These can typically be used together however *_lib and program should not be used together +# test_program can be used with program or static_lib, but program and static_lib cannot be used together all: static_lib clean: clean_object_files remove_binary_dir @@ -158,10 +163,6 @@ static_lib: $(SRC_OBJ) create_binary_dir @echo LINK $(PROJECT_BIN_PATH)/$(PROJECT_NAME).a @ar $(ARFLAGS) "$(PROJECT_BIN_PATH)/$(PROJECT_NAME).a" $(SRC_OBJ) -shared_lib: $(SRC_OBJ) create_binary_dir - @echo LINK $(PROJECT_BIN_PATH)/$(PROJECT_SO_FILENAME) - @gcc -shared -Wl,-soname,$(PROJECT_SONAME) -o "$(PROJECT_BIN_PATH)/$(PROJECT_SO_FILENAME)" $(SRC_OBJ) - # Build Program program: $(SRC_OBJ) create_binary_dir @echo LINK $(PROJECT_BIN_PATH)/$(PROJECT_NAME) diff --git a/makerom/makefile b/makerom/makefile index 2333865..60c4a4b 100644 --- a/makerom/makefile +++ b/makerom/makefile @@ -23,13 +23,6 @@ ifeq ($(ROOT_PROJECT_NAME),) export ROOT_PROJECT_DEPENDENCY_PATH = $(ROOT_PROJECT_PATH)/deps endif -# Shared Library Definitions -PROJECT_SO_VER_MAJOR = 0 -PROJECT_SO_VER_MINOR = 1 -PROJECT_SO_VER_PATCH = 0 -PROJECT_SONAME = $(PROJECT_NAME).so.$(PROJECT_SO_VER_MAJOR) -PROJECT_SO_FILENAME = $(PROJECT_SONAME).$(PROJECT_SO_VER_MINOR).$(PROJECT_SO_VER_PATCH) - # Project Dependencies PROJECT_DEPEND = polarssl yaml PROJECT_DEPEND_LOCAL_DIR = libpolarssl libyaml @@ -129,10 +122,10 @@ SRC_OBJ = $(foreach dir,$(PROJECT_SRC_SUBDIRS),$(subst .cpp,.o,$(wildcard $(dir) TESTSRC_OBJ = $(foreach dir,$(PROJECT_TESTSRC_SUBDIRS),$(subst .cpp,.o,$(wildcard $(dir)/*.cpp))) $(foreach dir,$(PROJECT_TESTSRC_SUBDIRS),$(subst .cc,.o,$(wildcard $(dir)/*.cc))) $(foreach dir,$(PROJECT_TESTSRC_SUBDIRS),$(subst .c,.o,$(wildcard $(dir)/*.c))) # all is the default, user should specify what the default should do -# - 'static_lib' for building static library -# - 'program' for building the program +# - 'static_lib' for building source as a static library +# - 'program' for building source as executable program # - 'test_program' for building the test program -# These can typically be used together however *_lib and program should not be used together +# test_program can be used with program or static_lib, but program and static_lib cannot be used together all: program clean: clean_object_files remove_binary_dir