Update Makefiles
This commit is contained in:
@@ -4,7 +4,11 @@
|
|||||||
|
|
||||||
include Makefile.conf
|
include Makefile.conf
|
||||||
|
|
||||||
ARNAME = $(notdir $(CURDIR)).a
|
PID := $(shell echo $$$$)
|
||||||
|
PREFIX = nice -n 19 /usr/bin/time --format='%E (%U)' -o /dev/shm/t-$(PID)
|
||||||
|
POSTFIX = && cat /dev/shm/t-$(PID) | xargs -I "%" echo -en '\033[100D\033[60C$1' "%\n" && rm -f /dev/shm/t-$(PID)
|
||||||
|
|
||||||
|
ARNAME = $(notdir $(CURDIR)).$(ARCH).a
|
||||||
|
|
||||||
SUBDIRS := $(wildcard */.)
|
SUBDIRS := $(wildcard */.)
|
||||||
SUBDIRS := $(foreach dir,$(SUBDIRS),$(subst /.,,$(dir)))
|
SUBDIRS := $(foreach dir,$(SUBDIRS),$(subst /.,,$(dir)))
|
||||||
@@ -13,14 +17,15 @@ SUBDIRS := $(filter-out $(FILTER),$(SUBDIRS))
|
|||||||
SUBDIRARS = $(foreach dir,$(SUBDIRS),$(dir)/$(dir).a)
|
SUBDIRARS = $(foreach dir,$(SUBDIRS),$(dir)/$(dir).a)
|
||||||
|
|
||||||
LOCALSOURCES = $(wildcard *.cpp *.cc)
|
LOCALSOURCES = $(wildcard *.cpp *.cc)
|
||||||
LOCALOBJECTS := $(LOCALSOURCES:.cpp=.o)
|
LOCALOBJECTS := $(LOCALSOURCES:.cpp=.$(ARCH).o)
|
||||||
LOCALOBJECTS := $(LOCALOBJECTS:.cc=.o)
|
LOCALOBJECTS := $(LOCALOBJECTS:.cc=.$(ARCH).o)
|
||||||
LOCALDEPENDS = $(LOCALOBJECTS:.o=.d)
|
LOCALDEPENDS = $(LOCALOBJECTS:.o=.d)
|
||||||
SOURCES = $(wildcard *.cpp */*.cpp */*/*.cpp */*/*/*.cpp)
|
SOURCES = $(wildcard *.cpp */*.cpp */*/*.cpp */*/*/*.cpp)
|
||||||
OBJECTS = $(SOURCES:.cpp=.o)
|
OBJECTS = $(SOURCES:.cpp=.$(ARCH).o)
|
||||||
DEPENDS = $(OBJECTS:.o=.d)
|
DEPENDS = $(OBJECTS:.o=.d)
|
||||||
TARGETS =
|
TARGETS =
|
||||||
|
|
||||||
|
|
||||||
$(LOCALOBJECTS): | $(SUBDIRS)
|
$(LOCALOBJECTS): | $(SUBDIRS)
|
||||||
$(OBJECTS): | $(SUBDIRS)
|
$(OBJECTS): | $(SUBDIRS)
|
||||||
|
|
||||||
@@ -34,29 +39,73 @@ ifneq ($(MAKECMDGOALS),clean)
|
|||||||
-include $(LOCALDEPENDS)
|
-include $(LOCALDEPENDS)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
%.d: %.cpp
|
%.$(ARCH).d: %.cpp
|
||||||
$(info [MM] $@)
|
@depth=$(MAKELEVEL); \
|
||||||
@$(CC) $(CFLAGS) $< -MM -MT $(@:.d=.o) >$@
|
while [ $${depth} -gt 0 ] ; do \
|
||||||
|
echo -n " "; \
|
||||||
|
depth=`expr $$depth - 1`; \
|
||||||
|
done; \
|
||||||
|
true
|
||||||
|
@echo -n " [MM] $@"
|
||||||
|
@$(PREFIX) $(CC) $(CFLAGS) $< -MM -MT $(@:.d=.o) >$@ $(POSTFIX)
|
||||||
|
|
||||||
%.o: %.cpp
|
%.$(ARCH).o: %.cpp
|
||||||
$(info [CC] $@)
|
@depth=$(MAKELEVEL); \
|
||||||
@nice -n 19 $(CC) -c $(CFLAGS) $< -o $@
|
while [ $${depth} -gt 0 ] ; do \
|
||||||
|
echo -n " "; \
|
||||||
|
depth=`expr $$depth - 1`; \
|
||||||
|
done; \
|
||||||
|
true
|
||||||
|
@echo -n " [CC] $@"
|
||||||
|
@$(PREFIX) $(CC) -c $(CFLAGS) $< -o $@ $(POSTFIX)
|
||||||
|
|
||||||
%.d: %.cc
|
%.$(ARCH).d: %.cc
|
||||||
$(info [MM] $@)
|
@depth=$(MAKELEVEL); \
|
||||||
@$(CC) $(CFLAGS) $< -MM -MT $(@:.d=.o) >$@
|
while [ $${depth} -gt 0 ] ; do \
|
||||||
|
echo -n " "; \
|
||||||
|
depth=`expr $$depth - 1`; \
|
||||||
|
done; \
|
||||||
|
true
|
||||||
|
@echo -n " [MM] $@"
|
||||||
|
@$(PREFIX) $(CC) $(CFLAGS) $< -MM -MT $(@:.d=.o) >$@ $(POSTFIX)
|
||||||
|
|
||||||
%.o: %.cc
|
%.$(ARCH).o: %.cc
|
||||||
$(info [CC] $@)
|
@depth=$(MAKELEVEL); \
|
||||||
@nice -n 19 $(CC) -c $(CFLAGS) $< -o $@
|
while [ $${depth} -gt 0 ] ; do \
|
||||||
|
echo -n " "; \
|
||||||
|
depth=`expr $$depth - 1`; \
|
||||||
|
done; \
|
||||||
|
true
|
||||||
|
@echo -n " [CC] $@"
|
||||||
|
@$(PREFIX) $(CC) -c $(CFLAGS) $< -o $@ $(POSTFIX)
|
||||||
|
|
||||||
$(ARNAME): $(SUBDIRS) $(LOCALOBJECTS)
|
$(ARNAME): $(SUBDIRS) $(LOCALOBJECTS)
|
||||||
$(info [AR] $@)
|
@depth=$(MAKELEVEL); \
|
||||||
@nice -n 19 $(AR) rcuT $@ $(LOCALOBJECTS) $(SUBDIRARS)
|
while [ $${depth} -gt 0 ] ; do \
|
||||||
|
echo -n " "; \
|
||||||
|
depth=`expr $$depth - 1`; \
|
||||||
|
done; \
|
||||||
|
true
|
||||||
|
@echo -n " [AR] $@"
|
||||||
|
@$(PREFIX) $(AR) rcuT $@ $(LOCALOBJECTS) $(SUBDIRARS) $(POSTFIX)
|
||||||
|
|
||||||
.PHONY: $(SUBDIRS)
|
.PHONY: $(SUBDIRS)
|
||||||
$(SUBDIRS):
|
$(SUBDIRS):
|
||||||
@$(MAKE) -S -C $@ artifacts
|
@depth=$(MAKELEVEL); \
|
||||||
|
while [ $${depth} -gt 0 ] ; do \
|
||||||
|
echo -n " "; \
|
||||||
|
depth=`expr $$depth - 1`; \
|
||||||
|
done; \
|
||||||
|
true
|
||||||
|
@echo " <$@>"
|
||||||
|
@$(MAKE) -s -S -C $@ artifacts
|
||||||
|
@depth=$(MAKELEVEL); \
|
||||||
|
while [ $${depth} -gt 0 ] ; do \
|
||||||
|
echo -n " "; \
|
||||||
|
depth=`expr $$depth - 1`; \
|
||||||
|
done; \
|
||||||
|
true
|
||||||
|
@echo " </$@>"
|
||||||
|
|
||||||
.PHONY: all
|
.PHONY: all
|
||||||
all: $(TARGETS)
|
all: $(TARGETS)
|
||||||
@@ -64,6 +113,18 @@ all: $(TARGETS)
|
|||||||
.PHONY: clean
|
.PHONY: clean
|
||||||
clean:
|
clean:
|
||||||
@for dir in $(SUBDIRS); do \
|
@for dir in $(SUBDIRS); do \
|
||||||
$(MAKE) -S -C $$dir $@; \
|
depth=$(MAKELEVEL); \
|
||||||
done
|
while [ $${depth} -gt 0 ] ; do \
|
||||||
|
echo -n " "; \
|
||||||
|
depth=`expr $$depth - 1`; \
|
||||||
|
done; \
|
||||||
|
echo " <$$dir>"; \
|
||||||
|
$(MAKE) -s -S -C $$dir $@; \
|
||||||
|
while [ $${depth} -gt 0 ] ; do \
|
||||||
|
echo -n " "; \
|
||||||
|
depth=`expr $$depth - 1`; \
|
||||||
|
done; \
|
||||||
|
echo " </$$dir>"; \
|
||||||
|
done; \
|
||||||
|
true
|
||||||
@rm -f $(LOCALOBJECTS) $(LOCALDEPENDS) $(ARNAME) $(TARGETS) || true
|
@rm -f $(LOCALOBJECTS) $(LOCALDEPENDS) $(ARNAME) $(TARGETS) || true
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
# Makefile.conf
|
# Makefile.conf
|
||||||
#
|
#
|
||||||
|
|
||||||
|
ARCH := armv6
|
||||||
CFLAGS := -g3 -O3 -fPIC -marm -march=armv6 -std=c++11
|
CFLAGS := -g3 -O3 -fPIC -marm -march=armv6 -std=c++11
|
||||||
CFLAGS += -Wall -Wextra -Wstrict-aliasing -fmax-errors=5 -Werror -Wunreachable-code -Wdisabled-optimization -Wformat=2 -Winit-self -Wlogical-op -Wmissing-include-dirs -Wnoexcept -Woverloaded-virtual -Wsign-promo -Wstrict-null-sentinel -Wswitch-default -Wno-unused -Wno-variadic-macros -Wno-parentheses -Wno-unused-parameter -fdiagnostics-show-option
|
CFLAGS += -Wall -Wextra -Wstrict-aliasing -fmax-errors=5 -Werror -Wunreachable-code -Wdisabled-optimization -Wformat=2 -Winit-self -Wlogical-op -Wmissing-include-dirs -Wnoexcept -Woverloaded-virtual -Wsign-promo -Wstrict-null-sentinel -Wswitch-default -Wno-unused -Wno-variadic-macros -Wno-parentheses -Wno-unused-parameter -fdiagnostics-show-option
|
||||||
# CFLAGS += -Wold-style-cast -Wundef -Wshadow -Wctor-dtor-privacy -Wredundant-decls -Wstrict-overflow=5 -Wcast-align
|
# CFLAGS += -Wold-style-cast -Wundef -Wshadow -Wctor-dtor-privacy -Wredundant-decls -Wstrict-overflow=5 -Wcast-align
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
# Makefile.conf
|
# Makefile.conf
|
||||||
#
|
#
|
||||||
|
|
||||||
|
ARCH := armv8
|
||||||
CFLAGS := -g3 -O3 -fPIC -marm -march=armv8-a -std=c++11
|
CFLAGS := -g3 -O3 -fPIC -marm -march=armv8-a -std=c++11
|
||||||
CFLAGS += -Wall -Wextra -Wstrict-aliasing -fmax-errors=5 -Werror -Wunreachable-code -Wdisabled-optimization -Wformat=2 -Winit-self -Wlogical-op -Wmissing-include-dirs -Wnoexcept -Woverloaded-virtual -Wsign-promo -Wstrict-null-sentinel -Wswitch-default -Wno-unused -Wno-variadic-macros -Wno-parentheses -Wno-unused-parameter -Wno-missing-field-initializers -fdiagnostics-show-option
|
CFLAGS += -Wall -Wextra -Wstrict-aliasing -fmax-errors=5 -Werror -Wunreachable-code -Wdisabled-optimization -Wformat=2 -Winit-self -Wlogical-op -Wmissing-include-dirs -Wnoexcept -Woverloaded-virtual -Wsign-promo -Wstrict-null-sentinel -Wswitch-default -Wno-unused -Wno-variadic-macros -Wno-parentheses -Wno-unused-parameter -Wno-missing-field-initializers -fdiagnostics-show-option
|
||||||
# CFLAGS += -Wold-style-cast -Wundef -Wshadow -Wctor-dtor-privacy -Wredundant-decls -Wstrict-overflow=5 -Wcast-align
|
# CFLAGS += -Wold-style-cast -Wundef -Wshadow -Wctor-dtor-privacy -Wredundant-decls -Wstrict-overflow=5 -Wcast-align
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
# Makefile.conf.local
|
# Makefile.conf.local
|
||||||
#
|
#
|
||||||
|
|
||||||
|
ARCH := x86-64
|
||||||
CFLAGS := -g3 -O3 -Wall -fPIC -std=c++11
|
CFLAGS := -g3 -O3 -Wall -fPIC -std=c++11
|
||||||
CFLAGS += -Wall -Wextra -Wstrict-aliasing -pedantic -fmax-errors=5 -Werror -Wunreachable-code -Wcast-qual -Wdisabled-optimization -Wformat=2 -Winit-self -Wlogical-op -Wmissing-include-dirs -Wnoexcept -Woverloaded-virtual -Wsign-promo -Wstrict-null-sentinel -Wswitch-default -Wno-unused -Wno-variadic-macros -Wno-parentheses -fdiagnostics-show-option
|
CFLAGS += -Wall -Wextra -Wstrict-aliasing -pedantic -fmax-errors=5 -Werror -Wunreachable-code -Wcast-qual -Wdisabled-optimization -Wformat=2 -Winit-self -Wlogical-op -Wmissing-include-dirs -Wnoexcept -Woverloaded-virtual -Wsign-promo -Wstrict-null-sentinel -Wswitch-default -Wno-unused -Wno-variadic-macros -Wno-parentheses -fdiagnostics-show-option
|
||||||
# CFLAGS += -Wold-style-cast -Wundef -Wshadow -Wctor-dtor-privacy -Wredundant-decls -Wstrict-overflow=5 -Wcast-align
|
# CFLAGS += -Wold-style-cast -Wundef -Wshadow -Wctor-dtor-privacy -Wredundant-decls -Wstrict-overflow=5 -Wcast-align
|
||||||
|
|||||||
+4
-4
@@ -2,18 +2,18 @@
|
|||||||
# Makefile.target
|
# Makefile.target
|
||||||
#
|
#
|
||||||
|
|
||||||
PresenceDetection: Application/PresenceDetection.o $(OBJECTS)
|
PresenceDetection: Application/PresenceDetection.$(ARCH).o $(OBJECTS)
|
||||||
$(eval $@_DATETIME := $(DATETIME))
|
$(eval $@_DATETIME := $(DATETIME))
|
||||||
@echo [LD] $@
|
@echo [LD] $@
|
||||||
@$(CC) -o $@ $^ $(LFLAGS) $(CFLAGS)
|
@$(PREFIX) $(CC) -o $@ $^ $(LFLAGS) $(CFLAGS) $(POSTFIX)
|
||||||
@$(OBJCOPY) --only-keep-debug $@ $(DEBUGDIR)/$@-$($@_DATETIME).debug
|
@$(OBJCOPY) --only-keep-debug $@ $(DEBUGDIR)/$@-$($@_DATETIME).debug
|
||||||
@$(STRIP) $(SFLAGS) $@
|
@$(STRIP) $(SFLAGS) $@
|
||||||
@$(OBJCOPY) --add-gnu-debuglink="$(DEBUGDIR)/$@-$($@_DATETIME).debug" $@
|
@$(OBJCOPY) --add-gnu-debuglink="$(DEBUGDIR)/$@-$($@_DATETIME).debug" $@
|
||||||
@chmod -x $(DEBUGDIR)/$@-$($@_DATETIME).debug
|
@chmod -x $(DEBUGDIR)/$@-$($@_DATETIME).debug
|
||||||
|
|
||||||
test: Application/Test.o $(OBJECTS)
|
test: Application/Test.$(ARCH).o $(OBJECTS)
|
||||||
@echo [LD] $@
|
@echo [LD] $@
|
||||||
@$(CC) -o $@ $^ $(LFLAGS) $(CFLAGS)
|
@$(PREFIX) $(CC) -o $@ $^ $(LFLAGS) $(CFLAGS) $(POSTFIX)
|
||||||
@$(STRIP) $(SFLAGS) $@
|
@$(STRIP) $(SFLAGS) $@
|
||||||
|
|
||||||
.DEFAULT_GOAL := PresenceDetection
|
.DEFAULT_GOAL := PresenceDetection
|
||||||
|
|||||||
Reference in New Issue
Block a user