|  | @@ -1,23 +1,22 @@
 | 
											
												
													
														|  |  #
 |  |  #
 | 
											
												
													
														|  |  # This Makefile takes .st files in the jtalk/st directory and produces compiled
 |  |  # This Makefile takes .st files in the jtalk/st directory and produces compiled
 | 
											
												
													
														|  | -# javascript files from them. It also produces one or more concatenated jtalk.js files
 |  | 
 | 
											
												
													
														|  | -# for development and deployment.
 |  | 
 | 
											
												
													
														|  | 
 |  | +# javascript files from them, for both debug and deployment.
 | 
											
												
													
														|  |  #
 |  |  #
 | 
											
												
													
														|  | -# Where we find the current runnable code and where we put our js files when we are done
 |  | 
 | 
											
												
													
														|  | 
 |  | +# Where we find the current runnable code and where we put our js files on install
 | 
											
												
													
														|  |  JS	:= ../js/
 |  |  JS	:= ../js/
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |  # The compiler script
 |  |  # The compiler script
 | 
											
												
													
														|  |  JTALKC	:= ../bin/jtalkc
 |  |  JTALKC	:= ../bin/jtalkc
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |  # Generic flags to JTALKC
 |  |  # Generic flags to JTALKC
 | 
											
												
													
														|  | -FLAGS   := -g
 |  | 
 | 
											
												
													
														|  | 
 |  | +FLAGS   := -d
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |  # All corresponding js filenames for every st file available
 |  |  # All corresponding js filenames for every st file available
 | 
											
												
													
														|  |  # In other words, if we have Kernel.st and Parser.st, then OBJECTS will be "Kernel.js Parser.js"
 |  |  # In other words, if we have Kernel.st and Parser.st, then OBJECTS will be "Kernel.js Parser.js"
 | 
											
												
													
														|  |  OBJECTS := $(patsubst %.st,%.js,$(wildcard *.st))
 |  |  OBJECTS := $(patsubst %.st,%.js,$(wildcard *.st))
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |  # Default make target since it is the first target in this Makefile
 |  |  # Default make target since it is the first target in this Makefile
 | 
											
												
													
														|  | -all: jtalk.deploy.js jtalk.js
 |  | 
 | 
											
												
													
														|  | 
 |  | +all: Examples.js
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |  # Step by step
 |  |  # Step by step
 | 
											
												
													
														|  |  #
 |  |  #
 | 
											
										
											
												
													
														|  | @@ -26,15 +25,11 @@ all: jtalk.deploy.js jtalk.js
 | 
											
												
													
														|  |  boot.js init.js:
 |  |  boot.js init.js:
 | 
											
												
													
														|  |  	cp ../js/$@ .
 |  |  	cp ../js/$@ .
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  | -# Then we compile Kernel.st using boot.js, Kernel.js, init.js
 |  | 
 | 
											
												
													
														|  | 
 |  | +# Then we compile Kernel.st depending on having using boot.js and init.js
 | 
											
												
													
														|  |  # $< means the first dependency - in other words Kernel.st
 |  |  # $< means the first dependency - in other words Kernel.st
 | 
											
												
													
														|  |  Kernel.js: Kernel.st boot.js init.js
 |  |  Kernel.js: Kernel.st boot.js init.js
 | 
											
												
													
														|  |  	$(JTALKC) $(FLAGS) $<
 |  |  	$(JTALKC) $(FLAGS) $<
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  | -# And one for deployment, no flags.
 |  | 
 | 
											
												
													
														|  | -deploy-Kernel.js: Kernel.st boot.js init.js
 |  | 
 | 
											
												
													
														|  | -	$(JTALKC) -p deploy- $<
 |  | 
 | 
											
												
													
														|  | -
 |  | 
 | 
											
												
													
														|  |  # ...then Parser, but using the new Kernel from step above.
 |  |  # ...then Parser, but using the new Kernel from step above.
 | 
											
												
													
														|  |  # We only need to depend on Kernel.js since it in turn depends on boot.js and init.js.
 |  |  # We only need to depend on Kernel.js since it in turn depends on boot.js and init.js.
 | 
											
												
													
														|  |  Parser.js: Parser.st Kernel.js
 |  |  Parser.js: Parser.st Kernel.js
 | 
											
										
											
												
													
														|  | @@ -46,8 +41,8 @@ Compiler.js: Compiler.st Parser.js
 | 
											
												
													
														|  |  	$(JTALKC) $(FLAGS) $<
 |  |  	$(JTALKC) $(FLAGS) $<
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |  # ...now that we have a new Kernel/Parser/Compiler we use them
 |  |  # ...now that we have a new Kernel/Parser/Compiler we use them
 | 
											
												
													
														|  | -# to compile the rest of st files that only depend on Compiler, like
 |  | 
 | 
											
												
													
														|  | -# for example Canvas.js, Benchfib.js etc
 |  | 
 | 
											
												
													
														|  | 
 |  | +# to compile the rest of st files presuming that they only depend on Compiler, like
 | 
											
												
													
														|  | 
 |  | +# for example Canvas.js and Benchfib.js.
 | 
											
												
													
														|  |  %.js: %.st Compiler.js 
 |  |  %.js: %.st Compiler.js 
 | 
											
												
													
														|  |  	$(JTALKC) $(FLAGS) $<
 |  |  	$(JTALKC) $(FLAGS) $<
 | 
											
												
													
														|  |  
 |  |  
 | 
											
										
											
												
													
														|  | @@ -57,37 +52,26 @@ Compiler.js: Compiler.st Parser.js
 | 
											
												
													
														|  |  #
 |  |  #
 | 
											
												
													
														|  |  # JQuery uses Canvas
 |  |  # JQuery uses Canvas
 | 
											
												
													
														|  |  JQuery.js: JQuery.st Canvas.js
 |  |  JQuery.js: JQuery.st Canvas.js
 | 
											
												
													
														|  | -	$(JTALKC) $(FLAGS) -l Canvas.js $<
 |  | 
 | 
											
												
													
														|  | 
 |  | +	$(JTALKC) $(FLAGS) -l Canvas $<
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |  # IDE uses JQuery
 |  |  # IDE uses JQuery
 | 
											
												
													
														|  |  IDE.js: IDE.st JQuery.js
 |  |  IDE.js: IDE.st JQuery.js
 | 
											
												
													
														|  | -	$(JTALKC) $(FLAGS) -l Canvas.js,JQuery.js $<
 |  | 
 | 
											
												
													
														|  | 
 |  | +	$(JTALKC) $(FLAGS) -l Canvas,JQuery $<
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |  # The SUnit TestRunner uses UI stuff from IDE.
 |  |  # The SUnit TestRunner uses UI stuff from IDE.
 | 
											
												
													
														|  |  SUnit.js: SUnit.st IDE.js
 |  |  SUnit.js: SUnit.st IDE.js
 | 
											
												
													
														|  | -	$(JTALKC) $(FLAGS) -l Canvas.js,JQuery.js,IDE.js $<
 |  | 
 | 
											
												
													
														|  | 
 |  | +	$(JTALKC) $(FLAGS) -l Canvas,JQuery,IDE $<
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |  # Some Examples use SUnit
 |  |  # Some Examples use SUnit
 | 
											
												
													
														|  |  Examples.js: Examples.st SUnit.js
 |  |  Examples.js: Examples.st SUnit.js
 | 
											
												
													
														|  | -	$(JTALKC) $(FLAGS) -l Canvas.js,JQuery.js,IDE.js,SUnit.js $<;
 |  | 
 | 
											
												
													
														|  | -
 |  | 
 | 
											
												
													
														|  | -# This is the deployment target with only the Jtalk Kernel compiled without -g.
 |  | 
 | 
											
												
													
														|  | -# Then we push it all through Closure (-O) and add init.js at end (-I).
 |  | 
 | 
											
												
													
														|  | -jtalk.deploy.js: boot.js init.js deploy-Kernel.js
 |  | 
 | 
											
												
													
														|  | -	$(JTALKC) -O -I boot.js deploy-Kernel.js jtalk.deploy;
 |  | 
 | 
											
												
													
														|  | -
 |  | 
 | 
											
												
													
														|  | -# Full IDE compiled with -g. We do not clean away objects at end.
 |  | 
 | 
											
												
													
														|  | -# Here we give -J (will include all  libs for Jtalk IDE),
 |  | 
 | 
											
												
													
														|  | -# push it all through Closure (-O) and add init.js at end (-I).
 |  | 
 | 
											
												
													
														|  | -jtalk.js: boot.js init.js $(OBJECTS)
 |  | 
 | 
											
												
													
														|  | -	$(JTALKC) -J -O -I jtalk;
 |  | 
 | 
											
												
													
														|  | 
 |  | +	$(JTALKC) $(FLAGS) -l Canvas,JQuery,IDE,SUnit $<;
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |  # Installing is simply copying all js files to js directory.
 |  |  # Installing is simply copying all js files to js directory.
 | 
											
												
													
														|  |  install: all
 |  |  install: all
 | 
											
												
													
														|  |  	cp *.js $(JS)
 |  |  	cp *.js $(JS)
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  | -# And cleaning is trivial
 |  | 
 | 
											
												
													
														|  | 
 |  | +# And cleaning is trivial also
 | 
											
												
													
														|  |  clean:
 |  |  clean:
 | 
											
												
													
														|  |  	rm -f *.js; 
 |  |  	rm -f *.js; 
 | 
											
												
													
														|  |  
 |  |  
 |