Permalink
Browse files

Simplifications to Examples/octave/example.mk

  • Loading branch information...
1 parent c110e79 commit 2a171fba8d843bcb36f1edf6c7647d011214449f @kwwette kwwette committed Jun 1, 2014
Showing with 22 additions and 15 deletions.
  1. +22 −15 Examples/octave/example.mk
View
@@ -6,27 +6,34 @@ SWIG = $(TOP)/../preinst-swig
TARGET = swigexample
INTERFACE = example.i
-check: build
- $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' octave_run
+BUILDCMD = \
+ $(MAKE) -f $(TOP)/Makefile \
+ SRCDIR='$(SRCDIR)' \
+ SWIG='$(SWIG)' \
+ INTERFACE='$(INTERFACE)'
-build:
ifneq (,$(SRCS))
- $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' SWIG='$(SWIG)' \
- SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' octave
+ BUILDCMD += SRCS='$(SRCS)'
+ BUILDTARGET = octave
else
- $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \
- SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' octave_cpp
+ BUILDCMD += CXXSRCS='$(CXXSRCS)'
+ BUILDTARGET = octave_cpp
endif
+
+check: build
+ $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' octave_run
+
+build:
+ $(BUILDCMD) SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' $(BUILDTARGET)
+
ifneq (,$(TARGET2)$(SWIGOPT2))
-ifneq (,$(SRCS))
- $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' SWIG='$(SWIG)' \
- SWIGOPT='$(SWIGOPT2)' TARGET='$(TARGET2)' INTERFACE='$(INTERFACE)' octave
-else
- $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \
- SWIGOPT='$(SWIGOPT2)' TARGET='$(TARGET2)' INTERFACE='$(INTERFACE)' octave_cpp
-endif
-endif
+check: build2
+
+build2:
+ $(BUILDCMD) SWIGOPT='$(SWIGOPT2)' TARGET='$(TARGET2)' $(BUILDTARGET)
+
+endif
clean:
$(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' octave_clean

0 comments on commit 2a171fb

Please sign in to comment.