From 3a4a5b9fb2717e65d4a5a34b821fcc5fc348ed8b Mon Sep 17 00:00:00 2001 From: jakcron Date: Tue, 7 Aug 2018 14:33:39 +0800 Subject: [PATCH] Update makefiles --- lib/libcompress/makefile | 1 - lib/libcrypto/makefile | 4 ++-- lib/libes/makefile | 1 - lib/libfnd/makefile | 1 - lib/libhac-hb/makefile | 1 - lib/libhac/makefile | 1 - lib/liblz4/makefile | 8 +++++--- lib/libpki/makefile | 1 - lib/libpolarssl/makefile | 8 +++++--- makefile | 2 +- programs/nstool/makefile | 7 ++++--- 11 files changed, 17 insertions(+), 18 deletions(-) diff --git a/lib/libcompress/makefile b/lib/libcompress/makefile index 931617a..3f009cb 100644 --- a/lib/libcompress/makefile +++ b/lib/libcompress/makefile @@ -7,7 +7,6 @@ DEPENDS = lz4 LIB_DIR = .. INCS = -I"include" $(foreach dep,$(DEPENDS), -I"$(LIB_DIR)/lib$(dep)/include") - # Compiler Settings CXXFLAGS = -std=c++11 $(INCS) -D__STDC_FORMAT_MACROS -Wall -Wno-unused-value CFLAGS = -std=c11 $(INCS) -Wall -Wno-unused-value diff --git a/lib/libcrypto/makefile b/lib/libcrypto/makefile index d1bf049..f41f545 100644 --- a/lib/libcrypto/makefile +++ b/lib/libcrypto/makefile @@ -1,15 +1,15 @@ # Sources SRC_DIR = source -OBJS = $(foreach dir,$(SRC_DIR),$(subst .cpp,.o,$(wildcard $(dir)/*.cpp))) +OBJS = $(foreach dir,$(SRC_DIR),$(subst .cpp,.o,$(wildcard $(dir)/*.cpp))) $(foreach dir,$(SRC_DIR),$(subst .c,.o,$(wildcard $(dir)/*.c))) # External dependencies DEPENDS = fnd polarssl LIB_DIR = .. INCS = -I"include" $(foreach dep,$(DEPENDS), -I"$(LIB_DIR)/lib$(dep)/include") - # Compiler Settings CXXFLAGS = -std=c++11 $(INCS) -D__STDC_FORMAT_MACROS -Wall -Wno-unused-value +CFLAGS = -std=c11 $(INCS) -Wall -Wno-unused-value ARFLAGS = cr -o ifeq ($(OS),Windows_NT) # Windows Only Flags/Libs diff --git a/lib/libes/makefile b/lib/libes/makefile index ba0b6e8..a6d2bf8 100644 --- a/lib/libes/makefile +++ b/lib/libes/makefile @@ -7,7 +7,6 @@ DEPENDS = fnd crypto LIB_DIR = .. INCS = -I"include" $(foreach dep,$(DEPENDS), -I"$(LIB_DIR)/lib$(dep)/include") - # Compiler Settings CXXFLAGS = -std=c++11 $(INCS) -D__STDC_FORMAT_MACROS -Wall -Wno-unused-value CFLAGS = -std=c11 $(INCS) -Wall -Wno-unused-value diff --git a/lib/libfnd/makefile b/lib/libfnd/makefile index a5a2c72..d453126 100644 --- a/lib/libfnd/makefile +++ b/lib/libfnd/makefile @@ -7,7 +7,6 @@ DEPENDS = LIB_DIR = .. INCS = -I"include" $(foreach dep,$(DEPENDS), -I"$(LIB_DIR)/lib$(dep)/include") - # Compiler Settings CXXFLAGS = -std=c++11 $(INCS) -D__STDC_FORMAT_MACROS -Wall -Wno-unused-value CFLAGS = -std=c11 $(INCS) -Wall -Wno-unused-value diff --git a/lib/libhac-hb/makefile b/lib/libhac-hb/makefile index f069c2b..fd763c5 100644 --- a/lib/libhac-hb/makefile +++ b/lib/libhac-hb/makefile @@ -7,7 +7,6 @@ DEPENDS = fnd crypto nx LIB_DIR = .. INCS = -I"include" $(foreach dep,$(DEPENDS), -I"$(LIB_DIR)/lib$(dep)/include") - # Compiler Settings CXXFLAGS = -std=c++11 $(INCS) -D__STDC_FORMAT_MACROS -Wall -Wno-unused-value CFLAGS = -std=c11 $(INCS) -Wall -Wno-unused-value diff --git a/lib/libhac/makefile b/lib/libhac/makefile index ba0b6e8..a6d2bf8 100644 --- a/lib/libhac/makefile +++ b/lib/libhac/makefile @@ -7,7 +7,6 @@ DEPENDS = fnd crypto LIB_DIR = .. INCS = -I"include" $(foreach dep,$(DEPENDS), -I"$(LIB_DIR)/lib$(dep)/include") - # Compiler Settings CXXFLAGS = -std=c++11 $(INCS) -D__STDC_FORMAT_MACROS -Wall -Wno-unused-value CFLAGS = -std=c11 $(INCS) -Wall -Wno-unused-value diff --git a/lib/liblz4/makefile b/lib/liblz4/makefile index 6fac1e6..a29d7be 100644 --- a/lib/liblz4/makefile +++ b/lib/liblz4/makefile @@ -1,12 +1,14 @@ # Sources SRC_DIR = source -OBJS = $(foreach dir,$(SRC_DIR), $(foreach dir,$(SRC_DIR),$(subst .c,.o,$(wildcard $(dir)/*.c))) +OBJS = $(foreach dir,$(SRC_DIR),$(subst .cpp,.o,$(wildcard $(dir)/*.cpp))) $(foreach dir,$(SRC_DIR),$(subst .c,.o,$(wildcard $(dir)/*.c))) # External dependencies -INCS = -I"include" - +DEPENDS = +LIB_DIR = .. +INCS = -I"include" $(foreach dep,$(DEPENDS), -I"$(LIB_DIR)/lib$(dep)/include") # Compiler Settings +CXXFLAGS = -std=c++11 $(INCS) -D__STDC_FORMAT_MACROS -Wall -Wno-unused-value CFLAGS = -std=c11 $(INCS) -Wall -Wno-unused-value ARFLAGS = cr -o ifeq ($(OS),Windows_NT) diff --git a/lib/libpki/makefile b/lib/libpki/makefile index ba0b6e8..a6d2bf8 100644 --- a/lib/libpki/makefile +++ b/lib/libpki/makefile @@ -7,7 +7,6 @@ DEPENDS = fnd crypto LIB_DIR = .. INCS = -I"include" $(foreach dep,$(DEPENDS), -I"$(LIB_DIR)/lib$(dep)/include") - # Compiler Settings CXXFLAGS = -std=c++11 $(INCS) -D__STDC_FORMAT_MACROS -Wall -Wno-unused-value CFLAGS = -std=c11 $(INCS) -Wall -Wno-unused-value diff --git a/lib/libpolarssl/makefile b/lib/libpolarssl/makefile index 6fac1e6..1507e0e 100644 --- a/lib/libpolarssl/makefile +++ b/lib/libpolarssl/makefile @@ -1,12 +1,14 @@ # Sources SRC_DIR = source -OBJS = $(foreach dir,$(SRC_DIR), $(foreach dir,$(SRC_DIR),$(subst .c,.o,$(wildcard $(dir)/*.c))) +OBJS = $(foreach dir,$(SRC_DIR),$(subst .c,.o,$(wildcard $(dir)/*.c))) # External dependencies -INCS = -I"include" - +DEPENDS = +LIB_DIR = .. +INCS = -I"include" $(foreach dep,$(DEPENDS), -I"$(LIB_DIR)/lib$(dep)/include") # Compiler Settings +CXXFLAGS = -std=c++11 $(INCS) -D__STDC_FORMAT_MACROS -Wall -Wno-unused-value CFLAGS = -std=c11 $(INCS) -Wall -Wno-unused-value ARFLAGS = cr -o ifeq ($(OS),Windows_NT) diff --git a/makefile b/makefile index e6acda4..3435159 100644 --- a/makefile +++ b/makefile @@ -3,7 +3,7 @@ LIB_DIR = $(PROJECT_DIR)/lib PROGRAM_DIR = $(PROJECT_DIR)/programs BIN_DIR = $(PROJECT_DIR)/bin -LIBS = libfnd libpolarssl liblz4 libcrypto libcompress libes libpki libhac libhac-hb +LIBS = libpolarssl liblz4 libfnd libcrypto libcompress libes libpki libhac libhac-hb PROGS = nstool main: build diff --git a/programs/nstool/makefile b/programs/nstool/makefile index 3b5bc7d..4359763 100644 --- a/programs/nstool/makefile +++ b/programs/nstool/makefile @@ -8,11 +8,9 @@ LIB_DIR = ../../lib LIBS = $(foreach dep,$(DEPENDS), -L"$(LIB_DIR)/lib$(dep)" -l$(dep)) INCS = $(foreach dep,$(DEPENDS), -I"$(LIB_DIR)/lib$(dep)/include") -BIN_DIR = bin -OUTPUT = $(BIN_DIR)/$(shell basename $(CURDIR)) - # Compiler Settings CXXFLAGS = -std=c++11 $(INCS) -D__STDC_FORMAT_MACROS -Wall -Wno-unused-value +CFLAGS = -std=c11 $(INCS) -Wall -Wno-unused-value ifeq ($(OS),Windows_NT) # Windows Only Flags/Libs CC = x86_64-w64-mingw32-gcc @@ -35,6 +33,9 @@ else endif endif +BIN_DIR = bin +OUTPUT = $(BIN_DIR)/$(shell basename $(CURDIR)) + all: build rebuild: clean build