Makefile 9.57 KB
Newer Older
1 2
# TTool Makefile
# Tested under Linux *only*
Ludovic Apvrille's avatar
Ludovic Apvrille committed
3
# Meant to work with svn
4 5 6 7 8 9 10 11 12 13 14

TARGET_ARCH = linux

JAVA = java
JAVAC  = javac
JAR    = jar
JAVADOC = javadoc
TAR = tar
DEBUG  = -g
CLASSPATH = -classpath
CLASSPATH = -sourcepath
15
PACKAGE = automata compiler/tmlparser nc ddtranslator launcher myutil tpndescription sddescription sdtranslator translator tmltranslator tmltranslator/toautomata tmltranslator/tosystemc  tmltranslator/tomappingsystemc tmltranslator/tomappingsystemc2 tmltranslator/touppaal tmltranslator/toturtle translator/tojava translator/tosimujava translator/totpn translator/touppaal  ui ui/ad ui/cd ui/oscd ui/osad ui/dd ui/file ui/graph ui/iod ui/ncdd ui/procsd ui/prosmdui/prosmd/util ui/tmlad ui/tmlcd ui/tmldd ui/tmlcomp ui/req ui/sd ui/tree ui/ucd ui/window tmltranslator tmltranslator/toturtle tmltranslator/tosystemc tmatrix uppaaldesc fr/inria/oasis/vercors/cttool/model remotesimulation
16 17 18 19 20 21 22
BUILDER = builder.jar
BUILD_INFO = build.txt
BUILD_TO_MODIFY = src/ui/DefaultText.java
TTOOL_BINARY = ttool.jar
LAUNCHER_BINARY = launcher.jar
TIFTRANSLATOR_BINARY = tiftranslator.jar
TMLTRANSLATOR_BINARY = tmltranslator.jar
23
REMOTESIMULATOR_BINARY = simulationcontrol.jar
24 25 26 27
TTOOL_JAR_TXT = ttool.txt
LAUNCHER_JAR_TXT = launcher.txt
TIFTRANSLATOR_JAR_TXT = tiftranslator.txt
TMLTRANSLATOR_JAR_TXT = tmltranslator.txt
28
REMOTESIMULATOR_JAR_TXT = simulationcontrol.txt
29
TTOOL_CONFIG = config.xml
Ludovic Apvrille's avatar
Ludovic Apvrille committed
30
TTOOL_CONFIG_SRC = config.xml
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
JTTOOL_JAR = jttool.jar
TTOOL_LOTOS_H =  spec
TTOOL_LOTOS_H_0 = spec_0.h 
TTOOL_LOTOS_H_1 = spec_1.h 
TTOOL_LOTOS_H_2 = spec_2.h 
TTOOL_LOTOS_H_3 = spec_3.h 
TTOOL_LOTOS_H_4 = spec_4.h 
TTOOL_LOTOS_H_5 = spec_5.h 
TTOOL_LOTOS_H_6 = spec_6.h 
TTOOL_LOTOS_H_7 = spec_7.h 
TTOOL_LOTOS_H_8 = spec_8.h 
TTOOL_LOTOS_H_9 = spec_9.h 

LOGO = starting_logo.gif
STD_LOGO = std_starting_logo.gif
ENTERPRISE_LOGO =  starting_logo_enterprise.gif

#Variable that points to TTool installation Path
TTOOL_PATH := $(shell /bin/pwd)
TTOOL_SRC = $(TTOOL_PATH)/src
TTOOL_BIN = $(TTOOL_PATH)/bin
Ludovic Apvrille's avatar
Ludovic Apvrille committed
52
TTOOL_MODELING = $(TTOOL_PATH)/modeling
53
TTOOL_SIMULATORS = $(TTOOL_PATH)/simulators
Ludovic Apvrille's avatar
Ludovic Apvrille committed
54 55
TTOOL_DOC = $(TTOOL_PATH)/doc
TTOOL_DOC_HTML = $(TTOOL_PATH)/doc/html
56 57 58 59
TTOOL_WORD = $(TTOOL_PATH)/doc/word
TTOOL_STD_RELEASE = $(TTOOL_PATH)/release/
JTTOOL = $(TTOOL_PATH)/javacode
JTTOOL_DIR = jttool
60
TTOOL_TARGET = $(TTOOL_PATH)/TTool_install/TTool
Ludovic Apvrille's avatar
Ludovic Apvrille committed
61
TTOOL_TARGET_RELEASE = $(TTOOL_PATH)/TTool_install
62

63
RELEASE_STD_FILES_XML = manual-HW.xml DrinkMachineV10.xml WebV01.xml Protocol_example1.xml BasicExchange.xml SmartCardProtocol.xml ProtocolPatterns.xml COCOME_V50.xml
64
RELEASE_STD_FILES_LIB =  TClock1.lib TTimerv01.lib
65
RELEASE_STD_FILES_BIN = $(TTOOL_CONFIG) $(LAUNCHER_BINARY) $(TTOOL_BINARY) $(TIFTRANSLATOR_BINARY) $(TMLTRANSLATOR_BINARY) $(REMOTESIMULATOR_BINARY) 
66 67 68
RELEASE_STD_FILES_LICENSES = LICENSE LICENSE_CECILL_ENG LICENSE_CECILL_FR

all:
69
	date
70
	svn update build.txt src/ui/DefaultText.java
71
	$(JAVA) -jar $(BUILDER) $(BUILD_INFO) $(BUILD_TO_MODIFY)
72
	svn commit build.txt src/ui/DefaultText.java -m 'update on build version: builder.txt'
73 74
	$(JAVAC) $(CLASSPATH) $(TTOOL_SRC) $(TTOOL_SRC)/*.java

Ludovic Apvrille's avatar
Ludovic Apvrille committed
75 76 77
basic:
	$(JAVAC) $(CLASSPATH) $(TTOOL_SRC) $(TTOOL_SRC)/*.java	

78 79 80
ttooljar_std:
	rm -f $(TTOOL_BIN)/$(TTOOL_BINARY)
	cp $(TTOOL_SRC)/ui/images/$(STD_LOGO) $(TTOOL_SRC)/ui/images/$(LOGO) 
81
	cd $(TTOOL_SRC);  $(JAR) cmf $(TTOOL_JAR_TXT) $(TTOOL_BIN)/$(TTOOL_BINARY) Main.class automata/*.class compiler/tmlparser/*.class nc/*.class  tmltranslator/*.class tmltranslator/toautomata/*.class tmatrix/*.class tmltranslator/toturtle/*.class tmltranslator/touppaal/*.class tmltranslator/tosystemc/*.class tmltranslator/tomappingsystemc/*.class tmltranslator/tomappingsystemc2/*.class  tpndescription/*.class ddtranslator/*.class launcher/*.class myutil/*.class sddescription/*.class sdtranslator/*.class translator/*.class translator/tojava/*.class  translator/tosimujava/*.class translator/touppaal/*.class translator/totpn/*.class ui/*.class ui/*/*.class ui/*/*/*.class uppaaldesc/*.class ui/images/*.* ui/images/toolbarButtonGraphics/general/*.gif ui/images/toolbarButtonGraphics/media/*.gif $(TTOOL_BIN)/$(LAUNCHER_BINARY) RTLLauncher.class launcher/*.class fr/inria/oasis/vercors/cttool/model/*.class remotesimulation/*.class
82 83 84 85 86 87 88 89 90 91 92 93 94 95


launcher:
	rm -f $(TTOOL_BIN)/$(LAUNCHER_BINARY)
	cd $(TTOOL_SRC);$(JAR) cmf $(LAUNCHER_JAR_TXT) $(TTOOL_BIN)/$(LAUNCHER_BINARY)  RTLLauncher.class launcher/*.class

tiftranslator:
	rm -f $(TTOOL_BIN)/$(TIFTRANSLATOR_BINARY)
	cd $(TTOOL_SRC);$(JAR) cmf $(TIFTRANSLATOR_JAR_TXT) $(TTOOL_BIN)/$(TIFTRANSLATOR_BINARY)  TIFTranslator.class translator/*.class translator/*/*.class myutil/*.class uppaaldesc/*.class ui/CheckingError.class compiler/tmlparser/*.class

tmltranslator:
	rm -f $(TTOOL_BIN)/$(TMLTRANSLATOR_BINARY)
	cd $(TTOOL_SRC);$(JAR) cmf $(TMLTRANSLATOR_JAR_TXT) $(TTOOL_BIN)/$(TMLTRANSLATOR_BINARY)  TMLTranslator.class tmltranslator/*.class tmltranslator/*/*.class myutil/*.class translator/*.class uppaaldesc/*.class ui/CheckingError.class compiler/tmlparser/*.class

96 97 98 99
remotesimulator:
	rm -f $(TTOOL_BIN)/$(REMOTESIMULATOR_BINARY)
	cd $(TTOOL_SRC);$(JAR) cmf $(REMOTESIMULATOR_JAR_TXT) $(TTOOL_BIN)/$(REMOTESIMULATOR_BINARY)  RemoteSimulationControl.class remotesimulation/*.class

100
documentation:
101
	$(JAVADOC) $(CLASSPATH) $(TTOOL_SRC) -d $(TTOOL_DOC_HTML) $(TTOOL_SRC)/*.java $(TTOOL_SRC)/*/*.java $(TTOOL_SRC)/*/*/*.java $(TTOOL_SRC)/fr/inria/oasis/vercors/cttool/model/*.java
102

103
release: jttooljar launcher tiftranslator tmltranslator remotesimulator ttooljar_std stdrelease 
104
	@echo release done
105

Ludovic Apvrille's avatar
Ludovic Apvrille committed
106
########## RELEASE
107
stdrelease:
Ludovic Apvrille's avatar
Ludovic Apvrille committed
108 109 110 111
	mkdir -p $(TTOOL_TARGET)
	rm -rf $(TTOOL_TARGET)/*
# java
	mkdir -p $(TTOOL_TARGET)/java
112
	cp $(TTOOL_BIN)/$(JTTOOL_JAR) $(TTOOL_TARGET)/java
Ludovic Apvrille's avatar
Ludovic Apvrille committed
113
	cp $(TTOOL_DOC)/README_java $(TTOOL_TARGET)/java
114
# modeling
Ludovic Apvrille's avatar
Ludovic Apvrille committed
115 116 117
	mkdir -p $(TTOOL_TARGET)/modeling
	cd $(TTOOL_MODELING); cp $(RELEASE_STD_FILES_XML) $(TTOOL_TARGET)/modeling
	cp $(TTOOL_DOC)/README_modeling $(TTOOL_TARGET)/modeling
118
# lib
Ludovic Apvrille's avatar
Ludovic Apvrille committed
119 120 121
	mkdir -p $(TTOOL_TARGET)/lib
	cd $(TTOOL_MODELING); cp $(RELEASE_STD_FILES_LIB) $(TTOOL_TARGET)/lib
	cp $(TTOOL_DOC)/README_lib $(TTOOL_TARGET)/lib
122
# simulators
123 124 125 126 127 128 129 130 131 132 133 134 135 136 137
	mkdir -p $(TTOOL_TARGET)/simulators/systemc1/src_simulator
	mkdir -p $(TTOOL_TARGET)/simulators/systemc1/lib
	cp  $(TTOOL_SIMULATORS)/systemc1/lib/README $(TTOOL_TARGET)/simulators/systemc1/lib/
	cp  $(TTOOL_SIMULATORS)/systemc1/Makefile $(TTOOL_TARGET)/simulators/systemc1
	cp  $(TTOOL_SIMULATORS)/systemc1/Makefile.defs $(TTOOL_TARGET)/simulators/systemc1
	cp  $(TTOOL_SIMULATORS)/systemc1/src_simulator/*.cpp $(TTOOL_TARGET)/simulators/systemc1/src_simulator
	cp  $(TTOOL_SIMULATORS)/systemc1/src_simulator/*.h $(TTOOL_TARGET)/simulators/systemc1/src_simulator
	mkdir -p $(TTOOL_TARGET)/simulators/c++2/src_simulator
	mkdir -p $(TTOOL_TARGET)/simulators/c++2/lib
	cp  $(TTOOL_SIMULATORS)/c++2/lib/README $(TTOOL_TARGET)/simulators/c++2/lib/
	cp  $(TTOOL_SIMULATORS)/c++2/Makefile $(TTOOL_TARGET)/simulators/c++2
	cp  $(TTOOL_SIMULATORS)/c++2/Makefile.defs $(TTOOL_TARGET)/simulators/c++2
	cp  $(TTOOL_SIMULATORS)/c++2/schedstyle.css $(TTOOL_TARGET)/simulators/c++2
	cp  $(TTOOL_SIMULATORS)/c++2/src_simulator/*.cpp $(TTOOL_TARGET)/simulators/c++2/src_simulator
	cp  $(TTOOL_SIMULATORS)/c++2/src_simulator/*.h $(TTOOL_TARGET)/simulators/c++2/src_simulator
138
# Licenses
Ludovic Apvrille's avatar
Ludovic Apvrille committed
139
	cd $(TTOOL_DOC); cp $(RELEASE_STD_FILES_LICENSES) $(TTOOL_TARGET)
140
# Main readme
Ludovic Apvrille's avatar
Ludovic Apvrille committed
141 142 143 144
	cp $(TTOOL_DOC)/README $(TTOOL_TARGET)
# LOTOS
	mkdir -p $(TTOOL_TARGET)/lotos
	cp $(TTOOL_DOC)/README_lotos $(TTOOL_TARGET)/lotos
145 146 147 148 149 150
#TML
	mkdir -p $(TTOOL_TARGET)/tmlcode
	cp $(TTOOL_DOC)/README_tml $(TTOOL_TARGET)/tmlcode
#UPPAAL
	mkdir -p $(TTOOL_TARGET)/uppaal
	cp $(TTOOL_DOC)/README_uppaal $(TTOOL_TARGET)/uppaal
Ludovic Apvrille's avatar
Ludovic Apvrille committed
151 152 153
# Figure
	mkdir -p $(TTOOL_TARGET)/figure
	cp $(TTOOL_DOC)/README_figure $(TTOOL_TARGET)/figure
154 155 156
# Basic doc
	mkdir -p $(TTOOL_TARGET)/doc
	cp $(TTOOL_DOC)/README_doc $(TTOOL_TARGET)/doc
Ludovic Apvrille's avatar
Ludovic Apvrille committed
157 158 159
# Basic bin
	mkdir -p $(TTOOL_TARGET)/bin
	cp $(TTOOL_DOC)/README_bin $(TTOOL_TARGET)/bin
160
	cp $(TTOOL_BIN)/configuration.gcf $(TTOOL_TARGET)/bin
Ludovic Apvrille's avatar
Ludovic Apvrille committed
161
	cp -R $(TTOOL_BIN)/$(TTOOL_LOTOS_H).h $(TTOOL_BIN)/$(TTOOL_LOTOS_H)_?.h $(TTOOL_BIN)/$(TTOOL_LOTOS_H)_?.t  $(TTOOL_BIN)/$(TTOOL_LOTOS_H)_?.f $(TTOOL_TARGET)/bin
162
	cp $(TTOOL_BIN)/$(TTOOL_BINARY) $(TTOOL_BIN)/$(LAUNCHER_BINARY) $(TTOOL_BIN)/$(TIFTRANSLATOR_BINARY) $(TTOOL_BIN)/$(TMLTRANSLATOR_BINARY) $(TTOOL_BIN)/$(TTOOL_CONFIG_SRC) $(TTOOL_TARGET)/bin
163
# Basic release
Ludovic Apvrille's avatar
Ludovic Apvrille committed
164
	cd $(TTOOL_TARGET_RELEASE);$(TAR) cfvz $(TTOOL_STD_RELEASE)/release.tgz *
165 166 167
# Advanced release
	$(JAVADOC) $(CLASSPATH) $(TTOOL_SRC) -d $(TTOOL_TARGET)/doc/srcdoc $(TTOOL_SRC)/*.java $(TTOOL_SRC)/*/*.java $(TTOOL_SRC)/*/*/*.java $(TTOOL_SRC)/fr/inria/oasis/vercors/cttool/model/*.java
	mkdir -p $(TTOOL_TARGET)/src
168
	cp -R $(TTOOL_SRC)/* $(TTOOL_TARGET)/src
169 170
	find $(TTOOL_TARGET)/src -type f -not \( -name '*.java' -o -name '*.gif' -o -name '*.jjt' -o -name '*.txt' \) -a -exec rm -f {} \;
	cp -R $(TTOOL_DOC)/README_src $(TTOOL_TARGET)/src
Ludovic Apvrille's avatar
Ludovic Apvrille committed
171
	cd $(TTOOL_TARGET_RELEASE);$(TAR) cfvz $(TTOOL_STD_RELEASE)/releaseWithSrc.tgz *
172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191


jttooljar:
	cd $(JTTOOL);$(JAVAC) $(JTTOOL_DIR)/*.java;$(JAR) cmf $(TTOOL_SRC)/$(TTOOL_JAR_TXT) $(TTOOL_BIN)/$(JTTOOL_JAR) $(JTTOOL_DIR)/*.class 

clean:
	rm -f $(TTOOL_SRC)/*.dot $(TTOOL_SRC)/*.dta $(TTOOL_SRC)/*.sim $(TTOOL_SRC)/*.lot
	rm -f $(TTOOL_SRC)/*.class $(TTOOL_SRC)/*.java~
	rm -f $(TTOOL_TARGET)/java/*
	rm -f $(TTOOL_TARGET)/modeling/*
	rm -f $(TTOOL_TARGET)/bin/*
	rm -f $(TTOOL_TARGET)/lotos/*
	rm -f $(TTOOL_TARGET)/doc/*
	rm -rf $(TTOOL_TARGET)/src/*
	rm -f $(TTOOL_TARGET)/lib/*
	@@for p in $(PACKAGE); do \
		echo rm -f $$p/*.class;\
		rm -f $(TTOOL_SRC)/$$p/*.class $(TTOOL_SRC)/$$p/*.java~; \
	done