Skip to content

Commit

Permalink
Add makefile for WordCount example
Browse files Browse the repository at this point in the history
  • Loading branch information
KIRSTEN W. HILDRUM committed Sep 28, 2015
1 parent 7f8541f commit 92d7fe0
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 1 deletion.
39 changes: 39 additions & 0 deletions demos/WordCount/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#####################################################################
# Copyright (C)2014, International Business Machines Corporation and
# others. All Rights Reserved.
#####################################################################

STREAMS_SPLPATH ?= ../../com.ibm.streamsx.hdfs
SPLC_FLAGS = -a --spl-path $(STREAMS_SPLPATH) --data-directory=data

#-t ../com.ibm.streamsx.hdfs -t ../../com.ibm.streamsx.hdfs

SPLC = $(STREAMS_INSTALL)/bin/sc

SPL_CMD_ARGS ?=
SPL_MAIN_COMPOSITE = WordCount
STANDALONE_OUTPUT_DIR = output/Standalone
DISTRIBUTED_OUTPUT_DIR = output/Distributed
SOURCES = WordCount.spl ReadAndTokenize.spl

all: distributed

standalone: output/Standalone/bin/standalone

distributed: output/Distributed/Main.sab

output/Standalone/bin/standalone: $(SOURCES)
$(SPLC) $(SPLC_FLAGS) -T -M $(SPL_MAIN_COMPOSITE) --output-dir ./$(STANDALONE_OUTPUT_DIR) $(SPL_CMD_ARGS)

output/Distributed/Main.sab: $(SOURCES)
$(SPLC) $(SPLC_FLAGS) -M $(SPL_MAIN_COMPOSITE) --output-dir ./$(DISTRIBUTED_OUTPUT_DIR) $(SPL_CMD_ARGS)

clean: clean-standalone clean-distributed

clean-standalone:
$(SPLC) $(SPLC_FLAGS) -C -M $(SPL_MAIN_COMPOSITE) --output-dir ./$(STANDALONE_OUTPUT_DIR)/$(SPL_MAIN_COMPOSITE)
-rm -rf toolkit.xml

clean-distributed:
$(SPLC) $(SPLC_FLAGS) -C -M $(SPL_MAIN_COMPOSITE) --output-dir ./$(DISTRIBUTED_OUTPUT_DIR)/$(SPL_MAIN_COMPOSITE)
-rm -rf toolkit.xml
2 changes: 1 addition & 1 deletion demos/WordCount/info.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<info:toolkitInfoModel xmlns:common="http://www.ibm.com/xmlns/prod/streams/spl/common" xmlns:info="http://www.ibm.com/xmlns/prod/streams/spl/toolkitInfo">
<info:identity>
<info:name>WordCount</info:name>
<info:description>Show how to implement WordCount and WordCountWithCombine</info:description>
<info:description>Show how to implement WordCount</info:description>
<info:version>1.0.0</info:version>
<info:requiredProductVersion>4.0</info:requiredProductVersion>
</info:identity>
Expand Down

0 comments on commit 92d7fe0

Please sign in to comment.