Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

swig python spits .py module; fixed bogus protobuf #5

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion functions.mk
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ $(GEN)/$(CWD)/$(2).pb.cc: $(SRC)/$(CWD)/$(1)

# We use the add_c++_source to do most of the work, then simply point
# to the file
$$(eval $$(call add_c++_source,$(2).pb.cc,$(2).pb,$(GEN),-IXX))
$$(eval $$(call add_c++_source,$(2).pb.cc,$(2).pb,$(GEN),))


# Point to the object file produced by the previous macro
Expand Down
5 changes: 2 additions & 3 deletions python.mk
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ define add_swig_source
ifneq ($(PREMAKE),1)
$(if $(trace),$$(warning called add_swig_source "$(1)" "$(2)"))

BUILD_$(OBJ)/$(CWD)/$(2)_wrap.cxx_COMMAND := swig -python -c++ -MMD -MF $(OBJ)/$(CWD)/$(2).d -MT "$(OBJ)/$(CWD)/$(2)_wrap.cxx $(OBJ)/$(CWD)/$(2).lo" -o $(OBJ)/$(CWD)/$(2)_wrap.cxx~ $(SRC)/$(CWD)/$(1)
BUILD_$(OBJ)/$(CWD)/$(2)_wrap.cxx_COMMAND := swig -python -c++ -MMD -MF $(OBJ)/$(CWD)/$(2).d -MT "$(OBJ)/$(CWD)/$(2)_wrap.cxx $(OBJ)/$(CWD)/$(2).lo" -outdir $(SRC)/$(CWD) -o $(OBJ)/$(CWD)/$(2)_wrap.cxx~ $(SRC)/$(CWD)/$(1)

# Call swig to generate the source file
$(OBJ)/$(CWD)/$(2)_wrap.cxx: $(SRC)/$(CWD)/$(1)
@mkdir -p $(OBJ)/$(CWD)
$$(if $(verbose_build),@echo $$(BUILD_$(OBJ)/$(CWD)/$(2)_wrap.cxx_COMMAND),@echo "[SWIG python] $(CWD)/$(1)")
$$(if $(verbose_build),@echo $$(BUILD_$(OBJ)/$(CWD)/$(2)_wrap.cxx_COMMAND),@echo " $(COLOR_BLUE)[SWIG python]$(COLOR_RESET) $(CWD)/$(1)")
@$$(BUILD_$(OBJ)/$(CWD)/$(2)_wrap.cxx_COMMAND)
@mv $$@~ $$@

Expand Down Expand Up @@ -139,7 +139,6 @@ run_$(1): $(BIN)/$(1)

$(BIN)/$(1): $(CWD)/$(2) $(BIN)/.dir_exists $$(foreach pymod,$(3),$(BIN)/$$(pymod)_pymod) $$(foreach pymod,$(3),$$(PYTHON_$$(pymod)_DEPS))
@echo "$(COLOR_BLUE)[PYTHON_PROGRAM]$(COLOR_RESET) $(1)"
@$(PYFLAKES) $$<
@cp $$< $$@~
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did you remove this line? Static checking of python code is very valuable!

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey that's not wanted - i obviously didn't mean to check that in

@chmod +x $$@~
@mv $$@~ $$@
Expand Down