Skip to content

Commit

Permalink
Remove .bin extension from binaries
Browse files Browse the repository at this point in the history
  • Loading branch information
bastih committed Oct 20, 2013
1 parent a813580 commit 5d79882
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 7 deletions.
1 change: 1 addition & 0 deletions makefiles/ci.mk
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.PHONY: ci_steps
ci_steps: coverage.xml sloccount.sc simian.xml

coverage.xml: ci_test
Expand Down
23 changes: 16 additions & 7 deletions rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,10 @@ $$($(1).objs) : LIB := $(1)
ifdef build_debug
$$(info loaded $(1) with deps $$($(1).deps))
endif
ifneq "$(MAKECMDGOALS)" "clean"
-include $$($(1).cpps:%=$$(OBJDIR)%.d)
endif
endif
endef

define binary
Expand All @@ -84,7 +86,7 @@ ifndef $(1).defined
$(1).deps ?=
$(1).cpps ?= $$(wildcard $($(1))/*.cpp)
$(1).objs ?= $$($(1).cpps:%=$(OBJDIR)%.o)
$(1).binary ?= $(RESULT_DIR)/$($(1).binname)_$(BLD).bin
$(1).binary ?= $(RESULT_DIR)/$($(1).binname)_$(BLD)
$(1).defined := is defined
$(1).libs ?=
# rules
Expand All @@ -106,9 +108,10 @@ $$($(1).objs) : CPPFLAGS += $$($(1).use_CPPFLAGS)
ifdef build_debug
$$(info loaded $(1) with deps $$($(1).deps))
endif

ifneq "$(MAKECMDGOALS)" "clean"
-include $$($(1).cpps:%=$$(OBJDIR)%.d)
endif
endif
endef

define full_link_binary
Expand All @@ -117,7 +120,7 @@ ifndef $(1).defined
$(1).deps ?=
$(1).cpps ?= $$(wildcard $($(1))/*.cpp)
$(1).objs ?= $$($(1).cpps:%=$(OBJDIR)%.o)
$(1).binary ?= $(RESULT_DIR)/$($(1).binname)_$(BLD).bin
$(1).binary ?= $(RESULT_DIR)/$($(1).binname)_$(BLD)
$(1).defined := is defined
$(1).libs ?=
# rules
Expand All @@ -139,13 +142,15 @@ $$($(1).objs) : CPPFLAGS += $$($(1).use_CPPFLAGS)
ifdef build_debug
$$(info loaded $(1) with deps $$($(1).deps))
endif

ifneq "$(MAKECMDGOALS)" "clean"
-include $$($(1).cpps:%=$$(OBJDIR)%.d)
endif
endif
endef

define test-binary
$(eval $(call binary,$(1)))
test-binaries += $$($(1).binary)
test: $$($(1).binary)
endef

Expand All @@ -167,7 +172,7 @@ LIBS := log4cxx
LINK_DIRS :=
INCLUDE_DIRS :=

WITH_PAPI := $(shell if [ "`papi_avail | grep Yes | wc -l`" -ne "0" ]; then echo 1; else echo 0; fi)
WITH_PAPI := $(shell if [ "`papi_avail 2>&1 | grep Yes | wc -l`" -ne "0" ]; then echo 1; else echo 0; fi)
WITH_MYSQL:= 1

include settings.mk
Expand Down Expand Up @@ -228,7 +233,7 @@ clean:

TESTPARAM = --minimal
test:
@$(foreach _,$(filter %.bin,$^),echo $(_);$(_) $(TESTPARAM);)
@$(foreach _,$(filter $(test-binaries),$^),echo $(_);$(_) $(TESTPARAM);)

ci_test: TESTPARAM = --gtest_output=xml:$(_).xml
ci_test: test
Expand All @@ -237,7 +242,11 @@ include makefiles/ci.mk

ci_build: ci_steps

%.bin:
# a noop to keep make happy
%.d : %.o
@true

% :
$(call echo_cmd,LINK $(CXX) $(BLD) $@) $(CXX) $(CXXFLAGS) -o $@ $(filter %.o,$^) -Wl,-whole-archive $(addprefix -l,$(LIBS)) -Wl,-no-whole-archive $(addprefix -L,$(LINK_DIRS)) $(LDFLAGS)

%.a:
Expand Down

0 comments on commit 5d79882

Please sign in to comment.