<commit_before>ifndef TARGETS
  TARGETS =
endif

ifndef CLEAN
  CLEAN =  *.class *~ *.dot *proof_file*.txt \#* .\#* 
endif 

ifndef SOURCES
  SOURCES =  $(addsuffix .java, $(TARGETS)) 
endif

ifndef SUBDIRSDEF
   SUBDIRSDEF = foo
   SUBDIRS = popl2008 pool visitor traditional multinh linkedlist subject
endif

ifndef DIR
   DIR = 
endif 

ifdef DIR
  INDENT := $(INDENT) " "
endif
export INDENT 

all: $(addsuffix .jimple, $(TARGETS)) 
	@for dir in ${SUBDIRS} ; do ( cd $$dir; make all ) ; done

test: all $(addsuffix .test, $(TARGETS)) $(addsuffix .test.dir, ${SUBDIRS})

time :  all $(addsuffix .time, $(TARGETS))
	@for dir in ${SUBDIRS} ; do ( cd $$dir; make time ) ; done

%.class: $(SOURCES)
	javac -g $?

%.jimple: %.class
	java soot.Main $* -f J -d . -print-tags -keep-line-number

%.test.dir: 
	@cd $*; make test

clean:: 
	for dir in ${SUBDIRS} ; do ( cd $$dir; make clean ) ; done
	@rm -f $(CLEAN)

%.time:
	@echo $(INDENT) Timing $(DIR)/$*
	@time ./runtest $*.jimple >/dev/null

%.test : %.jimple
	@echo -n .
	@./runtest $*.jimple<commit_msg>Made makefile simply touch the class files and jimple files to make them appear to be up-to-date if they cannot be made.  Currently in a fresh checkout the jimple and the Java file have the same timestamp, so Make tries to rebuild it, but if Java and Soot are not installed this will fail.  This addition to the Makefile deals with that case gracefully, by updating the timestamp on the jimple file to be more recent.  I know this is a Hack, but it should be reasonable behaviour in most cases.<commit_after>ifndef TARGETS
  TARGETS =
endif

ifndef CLEAN
  CLEAN =  *.class *~ *.dot *proof_file*.txt \#* .\#* 
endif 

ifndef SOURCES
  SOURCES =  $(addsuffix .java, $(TARGETS)) 
endif

ifndef SUBDIRSDEF
   SUBDIRSDEF = foo
   SUBDIRS = popl2008 pool visitor traditional multinh linkedlist subject
endif

ifndef DIR
   DIR = 
endif 

ifdef DIR
  INDENT := $(INDENT) " "
endif
export INDENT 

all: $(addsuffix .jimple, $(TARGETS)) 
	@for dir in ${SUBDIRS} ; do ( cd $$dir; make all ) ; done

test: all $(addsuffix .test, $(TARGETS)) $(addsuffix .test.dir, ${SUBDIRS})

time :  all $(addsuffix .time, $(TARGETS))
	@for dir in ${SUBDIRS} ; do ( cd $$dir; make time ) ; done

%.class: $(SOURCES)
	javac -g $?  || (echo "WARNING: Javac failed, using old class file" ; touch $@)

%.jimple: %.class
	java soot.Main $* -f J -d . -print-tags -keep-line-number  || (echo "WARNING: Soot failed, using old Jimple file." ; touch $@)

%.test.dir: 
	@cd $*; make test

clean:: 
	for dir in ${SUBDIRS} ; do ( cd $$dir; make clean ) ; done
	@rm -f $(CLEAN)

%.time:
	@echo $(INDENT) Timing $(DIR)/$*
	@time ./runtest $*.jimple >/dev/null

%.test : %.jimple
	@echo -n .
	@./runtest $*.jimple
{'fraction_non_alphanumeric': 0.1471019809244314, 'fraction_numerical': 0.00293470286133529, 'mean_word_length': 3.3354531001589827, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4917147', 'n_tokens_mistral': 1049, 'n_tokens_neox': 983, 'n_words': 358}