Makefile 20.8 KB
Newer Older
Florian Lugou's avatar
Florian Lugou committed
1 2
export JAVAC  		= javac
export JAR    		= jar
3
JAVA			= java
Florian Lugou's avatar
Florian Lugou committed
4 5 6 7
JAVADOC			= javadoc
MAKE			= make -s
TAR			= tar
GZIP			= gzip
8
GRADLE			= $(shell which gradle)
9
GRADLE_VERSION_NEEDED	= 3.3
10
ERROR_MSG		= printf "$(COLOR)\nBuild with gradle failed. Falling back to regular javac command...\n$(RESET)"
11

12
ifeq "$(GRADLE)" ""
13
    ERROR_MSG	= echo "Gradle was not found. Falling back to regular javac command...\n"
14 15
    GRADLE 	= false && echo >/dev/null
else
16
    GRADLE_VERSION 	:= $(shell $(GRADLE) --version | grep "^Gradle" | awk '{print $$2}')
17
    GRADLE_VERSION_MIN 	:= $(shell printf "%s\n%s\n" "$(GRADLE_VERSION_NEEDED)" "$(GRADLE_VERSION)" | sort -V 2>/dev/null | head -n1)
18 19
    ifneq "$(GRADLE_VERSION_NEEDED)" "$(GRADLE_VERSION_MIN)"
	ERROR_MSG	= echo "$(COLOR)Gradle $(GRADLE_VERSION) is too old. Needs at least $(GRADLE_VERSION_NEEDED). Falling back to regular javac command...\n$(RESET)"
20 21 22
	GRADLE = false && echo >/dev/null
    endif
endif
23 24 25 26

export COLOR		= $(shell tput setaf 1)
export RESET		= $(shell tput sgr0)
PREFIX			= [$(COLOR)BASE$(RESET)]             
Ludovic Apvrille's avatar
Ludovic Apvrille committed
27

Florian Lugou's avatar
Florian Lugou committed
28
export TTOOL_PATH 	:= $(shell /bin/pwd)
Ludovic Apvrille's avatar
Ludovic Apvrille committed
29 30

define HELP_message
31 32 33 34
Compilation targets:
--------------------
make all                Build TTool and the jar of companion software.
make ttool		Build TTool only.
Ludovic Apvrille's avatar
Ludovic Apvrille committed
35 36

Usual targets:
37 38 39 40 41 42 43 44 45 46
--------------
make (help)             Print this help.
make documentation      Generate the documentation of java classes using javadoc.
make release            Prepare a new release for the website.
			It produces the release.tgz and releaseWithSrc.tgz files.
make test               Run tests on TTool.
make publish_jar        Build TTool and upload the resulting archive.
			!!! Must have the right ssh key installed for this !!!
make clean              Clean the repository from compilation artifacts.
make ultraclean         Clean the repository from binaries and compilation artifacts.
Ludovic Apvrille's avatar
Ludovic Apvrille committed
47 48 49

Other targets:
--------------
50 51 52 53
make preinstall		Generate a preinstall version of TTool for Linux, Windows and
			MacOS and publish them on perso.telecom-paristech.fr.
			!!! Must have the right ssh key installed for this !!!
make git		Update the build number.
Ludovic Apvrille's avatar
Ludovic Apvrille committed
54 55 56


Please report bugs or suggestions of improvements to:
apvrille's avatar
apvrille committed
57
  ttool.telecom-paristech.fr/support.html
Ludovic Apvrille's avatar
Ludovic Apvrille committed
58 59 60
endef
export HELP_message

61
.PHONY: ttool clean launcher graphminimize graphshow tiftranslator tmltranslator rundse remotesimulator webcrawler documentation help ultraclean publish_jar preinstall test git
Ludovic Apvrille's avatar
Ludovic Apvrille committed
62 63 64 65

help:
	@echo "$$HELP_message"

Florian Lugou's avatar
Florian Lugou committed
66
FORCE:
Ludovic Apvrille's avatar
Ludovic Apvrille committed
67

Florian Lugou's avatar
Florian Lugou committed
68 69 70 71
# ======================================== 
# ========== SUB-PROJECTS BUILD ========== 
# ======================================== 
export TTOOL_SRC 		= $(TTOOL_PATH)/src/main/java
Florian Lugou's avatar
Florian Lugou committed
72
export GLOBAL_JAVA		= $(shell cd $(TTOOL_SRC); find . -name "[^.]*.java")
Florian Lugou's avatar
Florian Lugou committed
73 74 75 76 77 78
export TTOOL_RESOURCES		= $(TTOOL_PATH)/src/main/resources
export TTOOL_WEBCRAWLER_SRC 	= $(TTOOL_PATH)/src/main/java/web/crawler
export TTOOL_BIN 		= $(TTOOL_PATH)/bin
export TTOOL_LIBS		= $(TTOOL_PATH)/libs
export TTOOL_LIBRARIES		= $(wildcard $(TTOOL_LIBS)/*.jar)
export TTOOL_CLASSPATH		= $(subst $(eval) ,:,$(TTOOL_LIBRARIES))
Ludovic Apvrille's avatar
Ludovic Apvrille committed
79

80
export GLOBAL_CFLAGS		= -encoding "UTF8" -Xlint:unchecked -Xlint:deprecation -Xlint:cast -Xlint:divzero -Xlint:empty -Xlint:finally -Xlint:fallthrough
81

Florian Lugou's avatar
Florian Lugou committed
82 83
export TTOOL_DIR		= $(TTOOL_PATH)/ttool
export TTOOL_BINARY 		= $(TTOOL_BIN)/ttool.jar
Ludovic Apvrille's avatar
Ludovic Apvrille committed
84

Florian Lugou's avatar
Florian Lugou committed
85 86
export LAUNCHER_DIR		= $(TTOOL_PATH)/launcher
export LAUNCHER_BINARY 		= $(TTOOL_BIN)/launcher.jar
87

Florian Lugou's avatar
Florian Lugou committed
88 89
export GRAPHMINIMIZE_DIR	= $(TTOOL_PATH)/graphminimize
export GRAPHMINIMIZE_BINARY 	= $(TTOOL_BIN)/graphminimize.jar
90

Florian Lugou's avatar
Florian Lugou committed
91 92
export GRAPHSHOW_DIR		= $(TTOOL_PATH)/graphshow
export GRAPHSHOW_BINARY 	= $(TTOOL_BIN)/graphshow.jar
93

Florian Lugou's avatar
Florian Lugou committed
94 95
export TIFTRANSLATOR_DIR	= $(TTOOL_PATH)/tiftranslator
export TIFTRANSLATOR_BINARY 	= $(TTOOL_BIN)/tiftranslator.jar
96

Florian Lugou's avatar
Florian Lugou committed
97 98
export TMLTRANSLATOR_DIR	= $(TTOOL_PATH)/tmltranslator
export TMLTRANSLATOR_BINARY 	= $(TTOOL_BIN)/tmltranslator.jar
Ludovic Apvrille's avatar
Ludovic Apvrille committed
99

Florian Lugou's avatar
Florian Lugou committed
100 101
export RUNDSE_DIR		= $(TTOOL_PATH)/rundse
export RUNDSE_BINARY 		= $(TTOOL_BIN)/rundse.jar
102

Florian Lugou's avatar
Florian Lugou committed
103 104
export REMOTESIMULATOR_DIR	= $(TTOOL_PATH)/simulationcontrol
export REMOTESIMULATOR_BINARY 	= $(TTOOL_BIN)/simulationcontrol.jar
Ludovic Apvrille's avatar
Ludovic Apvrille committed
105

Florian Lugou's avatar
Florian Lugou committed
106 107
export WEBCRAWLER_CLIENT_DIR	= $(TTOOL_PATH)/webcrawler/client
export WEBCRAWLER_CLIENT_BINARY	= $(TTOOL_BIN)/webcrawler-client.jar
108

Florian Lugou's avatar
Florian Lugou committed
109 110
export WEBCRAWLER_SERVER_DIR	= $(TTOOL_PATH)/webcrawler/server
export WEBCRAWLER_SERVER_BINARY	= $(TTOOL_BIN)/webcrawler-server.jar
111

Florian Lugou's avatar
Florian Lugou committed
112 113
export JTTOOL_DIR		= $(TTOOL_PATH)/jttool
export JTTOOL_BINARY		= $(TTOOL_BIN)/jttool.jar
114

Florian Lugou's avatar
Florian Lugou committed
115
all: ttool launcher graphminimize graphshow tiftranslator tmltranslator rundse remotesimulator webcrawler
116

Florian Lugou's avatar
Florian Lugou committed
117
ttool: $(TTOOL_BINARY)
118

Florian Lugou's avatar
Florian Lugou committed
119
$(TTOOL_BINARY): FORCE
120
	@($(GRADLE) :ttool:build) || ($(ERROR_MSG) && $(MAKE) -C $(TTOOL_DIR) -e $@)
121

Florian Lugou's avatar
Florian Lugou committed
122
launcher: $(LAUNCHER_BINARY)
123

Florian Lugou's avatar
Florian Lugou committed
124
$(LAUNCHER_BINARY): FORCE
125
	@($(GRADLE) :launcher:build) || ($(ERROR_MSG) && $(MAKE) -C $(LAUNCHER_DIR) -e $@)
126

Florian Lugou's avatar
Florian Lugou committed
127
graphminimize: $(GRAPHMINIMIZE_BINARY)
128

Florian Lugou's avatar
Florian Lugou committed
129
$(GRAPHMINIMIZE_BINARY): FORCE
130
	@($(GRADLE) :graphminimize:build) || ($(ERROR_MSG) && $(MAKE) -C $(GRAPHMINIMIZE_DIR) -e $@)
131

Florian Lugou's avatar
Florian Lugou committed
132
graphshow: $(GRAPHSHOW_BINARY)
133

Florian Lugou's avatar
Florian Lugou committed
134
$(GRAPHSHOW_BINARY): FORCE
135
	@($(GRADLE) :graphshow:build) || ($(ERROR_MSG) && $(MAKE) -C $(GRAPHSHOW_DIR) -e $@)
Florian Lugou's avatar
Florian Lugou committed
136 137 138 139

tiftranslator: $(TIFTRANSLATOR_BINARY)

$(TIFTRANSLATOR_BINARY): FORCE
140
	@($(GRADLE) :tiftranslator:build) || ($(ERROR_MSG) && $(MAKE) -C $(TIFTRANSLATOR_DIR) -e $@)
Florian Lugou's avatar
Florian Lugou committed
141 142 143 144

tmltranslator: $(TMLTRANSLATOR_BINARY)

$(TMLTRANSLATOR_BINARY): FORCE
145
	@($(GRADLE) :tmltranslator:build) || ($(ERROR_MSG) && $(MAKE) -C $(TMLTRANSLATOR_DIR) -e $@)
Florian Lugou's avatar
Florian Lugou committed
146 147 148 149

rundse: $(RUNDSE_BINARY)

$(RUNDSE_BINARY): FORCE
150
	@($(GRADLE) :rundse:build) || ($(ERROR_MSG) && $(MAKE) -C $(RUNDSE_DIR) -e $@)
Florian Lugou's avatar
Florian Lugou committed
151 152 153 154

remotesimulator: $(REMOTESIMULATOR_BINARY)

$(REMOTESIMULATOR_BINARY): FORCE
155
	@($(GRADLE) :simulationcontrol:build) || ($(ERROR_MSG) && $(MAKE) -C $(REMOTESIMULATOR_DIR) -e $@)
Florian Lugou's avatar
Florian Lugou committed
156 157 158 159

webcrawler: $(WEBCRAWLER_CLIENT_BINARY) $(WEBCRAWLER_SERVER_BINARY)

$(WEBCRAWLER_CLIENT_BINARY): FORCE
160
	@($(GRADLE) :webcrawler-client:build) || ($(ERROR_MSG) && $(MAKE) -C $(WEBCRAWLER_CLIENT_DIR) -e $@)
Florian Lugou's avatar
Florian Lugou committed
161 162

$(WEBCRAWLER_SERVER_BINARY): FORCE
163
	@($(GRADLE) :webcrawler-server:build) || ($(ERROR_MSG) && $(MAKE) -C $(WEBCRAWLER_SERVER_DIR) -e $@)
Florian Lugou's avatar
Florian Lugou committed
164 165 166 167 168 169 170 171 172 173

$(JTTOOL_BINARY): FORCE
	@$(MAKE) -C $(JTTOOL_DIR) -e $@

# ======================================== 
# ==========    DOCUMENTATION   ========== 
# ======================================== 
TTOOL_DOC			= $(TTOOL_PATH)/doc
export TTOOL_DOC_HTML 		= $(TTOOL_DOC)/html

174
DOCFLAGS			= -encoding "UTF8" -quiet -J-Xmx256m -classpath $(TTOOL_CLASSPATH) -d $(TTOOL_DOC_HTML)
Florian Lugou's avatar
Florian Lugou committed
175 176 177 178 179 180 181 182 183 184 185 186 187 188

documentation: $(patsubst %,$(TTOOL_SRC)/%,$(GLOBAL_JAVA))
	@echo "$(PREFIX) Generating Javadoc"
	@$(JAVADOC) $(DOCFLAGS) $^

# ======================================== 
# ==========      RELEASES      ========== 
# ======================================== 
TTOOL_PRIVATE 			?= $(TTOOL_PATH)/../TTool-Private

PROD_USERNAME			= apvrille
PROD_ADDRESS			= ssh.enst.fr
PROD_PATH			= public_html/docs

189
TTOOL_DOC_AVATARCODEGENERATION_DIR 	= $(TTOOL_DOC)/codegeneration
190
TTOOL_DOC_SOCLIB_USERGUIDE_DIR 		= $(TTOOL_DOC)/documents_soclib/USER_GUIDE
apvrille's avatar
apvrille committed
191
TTOOL_DOC_SOCLIB_INSTALLATIONGUIDE_DIR 	= $(TTOOL_DOC)/documents_soclib/INSTALLATION_GUIDE
192

Florian Lugou's avatar
Florian Lugou committed
193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211
TTOOL_MODELING			= $(TTOOL_PATH)/modeling
TTOOL_SIMULATORS 		= $(TTOOL_PATH)/simulators
TTOOL_FIGURES 			= $(TTOOL_PATH)/figures
TTOOL_EXECUTABLECODE 		= $(TTOOL_PATH)/executablecode
TTOOL_MPSOC 			= $(TTOOL_PATH)/MPSoC
TTOOL_STD_RELEASE 		= $(TTOOL_PATH)/release
TTOOL_TARGET_RELEASE 		= $(TTOOL_PATH)/TTool_install
TTOOL_TARGET 			= $(TTOOL_TARGET_RELEASE)/TTool
TTOOL_TARGET_WINDOWS		= $(TTOOL_TARGET_RELEASE)/Windows
TTOOL_TARGET_MACOS		= $(TTOOL_TARGET_RELEASE)/MacOS
TTOOL_TARGET_LINUX		= $(TTOOL_TARGET_RELEASE)/Linux

BASERELEASE			= $(TTOOL_STD_RELEASE)/baseRelease.tar
STDRELEASE			= $(TTOOL_STD_RELEASE)/release.tgz
ADVANCED_RELEASE		= $(TTOOL_STD_RELEASE)/releaseWithSrc.tgz
TTOOL_PREINSTALL_LINUX 		= $(TTOOL_STD_RELEASE)/ttoollinux.tgz
TTOOL_PREINSTALL_WINDOWS 	= $(TTOOL_STD_RELEASE)/ttoolwindows.tgz
TTOOL_PREINSTALL_MACOS 		= $(TTOOL_STD_RELEASE)/ttoolmacos.tgz

212 213 214 215
BUILDER			= $(TTOOL_PATH)/builder.jar
BUILD_INFO		= build.txt
BUILD_TO_MODIFY		= $(TTOOL_SRC)/ui/util/DefaultText.java

Florian Lugou's avatar
Florian Lugou committed
216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252
TTOOL_LOTOS_H		= $(patsubst $(TTOOL_DIR)/runtime/%,$(TTOOL_BIN)/%,$(wildcard $(TTOOL_DIR)/runtime/spec*))

RELEASE_STD_FILES_XML 	= $(patsubst %,$(TTOOL_MODELING)/%,\
			  TURTLE/manual-HW.xml \
			  TURTLE/WebV01.xml \
			  TURTLE/Protocol_example1.xml \
			  TURTLE/BasicExchange.xml \
			  DIPLODOCUS/SmartCardProtocol.xml \
			  TURTLE/ProtocolPatterns.xml \
			  CTTool/COCOME_V50.xml \
			  AVATAR/CoffeeMachine_Avatar.xml \
			  AVATAR/Network_Avatar.xml \
			  AVATAR/MicroWaveOven_SafetySecurity_fullMethodo.xml)
RELEASE_STD_FILES_LIB 	= $(patsubst %,$(TTOOL_MODELING)/%,\
			  TURTLE/TClock1.lib \
			  TURTLE/TTimerv01.lib)
RELEASE_STD_FILES_LICENSES 	= $(patsubst %,$(TTOOL_DOC)/%,\
			     	  LICENSE \
				  LICENSE_CECILL_ENG \
				  LICENSE_CECILL_FR)
TTOOL_EXE 		= $(patsubst %,$(TTOOL_DOC)/%,\
			  ttool_linux.exe \
			  ttool_macosx.exe \
			  ttool_windows.bat)
TTOOL_CONFIG_SRC 	= $(patsubst %,$(TTOOL_DOC)/%,\
			  config_linux.xml \
			  config_macosx.xml \
			  config_windows.xml)

release: $(STDRELEASE) $(ADVANCED_RELEASE)

$(TTOOL_STD_RELEASE)/%.tgz: $(TTOOL_STD_RELEASE)/%.tar
	@$(GZIP) -c $< > $@

$(STDRELEASE:.tgz=.tar): $(BASERELEASE:.tgz=.tar)
	@echo "$(PREFIX) Generating standard release"
	@cp $< $@
Ludovic Apvrille's avatar
Ludovic Apvrille committed
253
# LOTOS
Florian Lugou's avatar
Florian Lugou committed
254 255
	@mkdir -p $(TTOOL_TARGET)/lotos
	@cp $(TTOOL_DOC)/README_lotos $(TTOOL_TARGET)/lotos
Ludovic Apvrille's avatar
Ludovic Apvrille committed
256
#NC
Florian Lugou's avatar
Florian Lugou committed
257 258 259 260 261 262 263 264 265
	@mkdir -p $(TTOOL_TARGET)/nc
	@cp $(TTOOL_DOC)/README_nc $(TTOOL_TARGET)/nc
# Figures
	@cp $(TTOOL_FIGURES)/Makefile $(TTOOL_TARGET)/figures
	@cp $(TTOOL_FIGURES)/mli.mk $(TTOOL_TARGET)/figures
# JTTool
	@mkdir -p $(TTOOL_TARGET)/java
	@cp $(JTTOOL_BINARY) $(TTOOL_TARGET)/java
	@cp $(TTOOL_DOC)/README_java $(TTOOL_TARGET)/java
Ludovic Apvrille's avatar
Ludovic Apvrille committed
266
# Basic bin
Florian Lugou's avatar
Florian Lugou committed
267
	@cp $(TTOOL_EXE) $(TTOOL_TARGET)/
268
	@cp $(TTOOL_CONFIG_SRC) $(TTOOL_TARGET)/bin
Florian Lugou's avatar
Florian Lugou committed
269
	@cp $(TTOOL_LOTOS_H) $(TTOOL_TARGET)/bin
270
	@$(TAR) uf $@ -C $(TTOOL_TARGET_RELEASE) TTool/lotos TTool/nc TTool/bin TTool/java TTool/figures TTool/doc/prototyping_with_soclib_installation_guide.pdf TTool/doc/prototyping_with_soclib_user_guide.pdf  $(patsubst $(TTOOL_DOC)/%,TTool/%,$(TTOOL_EXE))
Florian Lugou's avatar
Florian Lugou committed
271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288

$(ADVANCED_RELEASE:.tgz=.tar): $(STDRELEASE:.tgz=.tar) documentation
	@echo "$(PREFIX) Generating advanced release"
	@cp $< $@
	@cp -r $(TTOOL_DOC_HTML) $(TTOOL_TARGET)/doc/srcdoc
	@mkdir -p $(TTOOL_TARGET)/src
	@cp -R $(TTOOL_SRC)/* $(TTOOL_TARGET)/src
	@cp -r $(TTOOL_DIR)/src/main/java/* $(TTOOL_TARGET)/src
	@cp -r $(LAUNCHER_DIR)/src/main/java/* $(TTOOL_TARGET)/src
	@cp -r $(GRAPHMINIMIZE_DIR)/src/main/java/* $(TTOOL_TARGET)/src
	@cp -r $(GRAPHSHOW_DIR)/src/main/java/* $(TTOOL_TARGET)/src
	@cp -r $(TIFTRANSLATOR_DIR)/src/main/java/* $(TTOOL_TARGET)/src
	@cp -r $(TMLTRANSLATOR_DIR)/src/main/java/* $(TTOOL_TARGET)/src
	@cp -r $(RUNDSE_DIR)/src/main/java/* $(TTOOL_TARGET)/src
	@cp -r $(REMOTESIMULATOR_DIR)/src/main/java/* $(TTOOL_TARGET)/src
	@cp -r $(WEBCRAWLER_CLIENT_DIR)/src/main/java/* $(TTOOL_TARGET)/src
	@cp -r $(WEBCRAWLER_SERVER_DIR)/src/main/java/* $(TTOOL_TARGET)/src
	@find $(TTOOL_TARGET)/src -type f -not \( -name '*.java' -o -name '*.gif' -o -name '*.jjt' -o -name '*.txt' \) -a -exec rm -f {} \;
Ludovic Apvrille's avatar
Ludovic Apvrille committed
289
	@cp $(TTOOL_DOC)/README_src $(TTOOL_TARGET)/src
Florian Lugou's avatar
Florian Lugou committed
290 291 292 293 294 295 296 297
	@$(TAR) uf $@ -C $(TTOOL_TARGET_RELEASE) TTool/doc/srcdoc TTool/src

$(TTOOL_PREINSTALL_WINDOWS:.tgz=.tar): $(BASERELEASE:.tgz=.tar)
	@echo "$(PREFIX) Generating preinstall for Windows"
	@cp $< $@
	@mkdir -p $(TTOOL_TARGET_WINDOWS)/TTool/bin
	@$(TAR) xzvf $(TTOOL_PRIVATE)/stocks/proverif_windows.tar.gz -C $(TTOOL_TARGET_WINDOWS)
	@$(TAR) xzvf $(TTOOL_PRIVATE)/stocks/uppaal.tar.gz -C $(TTOOL_TARGET_WINDOWS)
298 299 300
	@cp $(TTOOL_DOC)/config_windows.xml $(TTOOL_TARGET_WINDOWS)/TTool/bin/
	@sed 's#chdir .*#chdir TTool/bin#' $(TTOOL_DOC)/ttool_windows.bat > $(TTOOL_TARGET_WINDOWS)/ttool.bat
	@$(TAR) uf $@ -C $(TTOOL_TARGET_WINDOWS) proverif uppaal TTool/bin/config_windows.xml ttool.bat
Florian Lugou's avatar
Florian Lugou committed
301 302 303 304 305 306 307 308

$(TTOOL_PREINSTALL_MACOS:.tgz=.tar): $(BASERELEASE:.tgz=.tar)
	@echo "$(PREFIX) Generating preinstall for MacOS"
	@cp $< $@
	@mkdir -p $(TTOOL_TARGET_MACOS)/TTool/bin
	@$(TAR) xzf $(TTOOL_PRIVATE)/stocks/proverif_macos.tar.gz -C $(TTOOL_TARGET_MACOS)
	@$(TAR) xzf $(TTOOL_PRIVATE)/stocks/uppaal_macos.tar.gz -C $(TTOOL_TARGET_MACOS)
	@mv $(TTOOL_TARGET_MACOS)/uppaal* $(TTOOL_TARGET_MACOS)/uppaal
309 310 311
	@cp $(TTOOL_DOC)/config_macosx.xml $(TTOOL_TARGET_MACOS)/TTool/bin/config_macosx.xml
	@sed 's#cd [^;]*#cd TTool/bin#' $(TTOOL_DOC)/ttool_macosx.exe > $(TTOOL_TARGET_MACOS)/ttool.exe
	@$(TAR) uf $@ -C $(TTOOL_TARGET_MACOS) proverif uppaal TTool/bin/config_macosx.xml ttool.exe
Florian Lugou's avatar
Florian Lugou committed
312 313 314 315 316 317 318

$(TTOOL_PREINSTALL_LINUX:.tgz=.tar): $(BASERELEASE:.tgz=.tar)
	@echo "$(PREFIX) Generating preinstall for Linux"
	@cp $< $@
	@mkdir -p $(TTOOL_TARGET_LINUX)/TTool/bin
	@$(TAR) xzvf $(TTOOL_PRIVATE)/stocks/proverif_linux.tar.gz -C $(TTOOL_TARGET_LINUX)
	@$(TAR) xzvf $(TTOOL_PRIVATE)/stocks/uppaal.tar.gz -C $(TTOOL_TARGET_LINUX)
319 320 321
	@cp $(TTOOL_DOC)/config_linux.xml $(TTOOL_TARGET_LINUX)/TTool/bin/config_linux.xml
	@sed 's#cd [^;]*#cd TTool/bin#' $(TTOOL_DOC)/ttool_linux.exe > $(TTOOL_TARGET_LINUX)/ttool.exe
	@$(TAR) uf $@ -C $(TTOOL_TARGET_LINUX) proverif uppaal TTool/bin/config_linux.xml ttool.exe
Florian Lugou's avatar
Florian Lugou committed
322

323
$(BASERELEASE:.tgz=.tar): $(JTTOOL_BINARY) $(TTOOL_BINARY) $(LAUNCHER_BINARY) $(TIFTRANSLATOR_BINARY) $(TMLTRANSLATOR_BINARY) $(RUNDSE_BINARY) FORCE
Florian Lugou's avatar
Florian Lugou committed
324
	@echo "$(PREFIX) Preparing base release"
325
	@rm -rf $(TTOOL_TARGET_RELEASE)
Florian Lugou's avatar
Florian Lugou committed
326 327 328 329 330
	@mkdir -p $(TTOOL_TARGET)
# modeling
	@mkdir -p $(TTOOL_TARGET)/modeling
	@cp $(RELEASE_STD_FILES_XML) $(TTOOL_TARGET)/modeling
	@cp $(TTOOL_DOC)/README_modeling $(TTOOL_TARGET)/modeling
331
# lib
Florian Lugou's avatar
Florian Lugou committed
332 333 334
	@mkdir -p $(TTOOL_TARGET)/lib
	@cp $(RELEASE_STD_FILES_LIB) $(TTOOL_TARGET)/lib
	@cp $(TTOOL_DOC)/README_lib $(TTOOL_TARGET)/lib
335
# DIPLODOCUS simulators
Florian Lugou's avatar
Florian Lugou committed
336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359
	@mkdir -p $(TTOOL_TARGET)/simulators/c++2/src_simulator/app
	@mkdir -p $(TTOOL_TARGET)/simulators/c++2/src_simulator/arch
	@mkdir -p $(TTOOL_TARGET)/simulators/c++2/src_simulator/ebrdd
	@mkdir -p $(TTOOL_TARGET)/simulators/c++2/src_simulator/evt
	@mkdir -p $(TTOOL_TARGET)/simulators/c++2/src_simulator/sim
	@mkdir -p $(TTOOL_TARGET)/simulators/c++2/src_simulator/TEPE
	@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/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
	@cp  $(TTOOL_SIMULATORS)/c++2/src_simulator/app/*.cpp $(TTOOL_TARGET)/simulators/c++2/src_simulator/app
	@cp  $(TTOOL_SIMULATORS)/c++2/src_simulator/app/*.h $(TTOOL_TARGET)/simulators/c++2/src_simulator/app
	@cp  $(TTOOL_SIMULATORS)/c++2/src_simulator/arch/*.cpp $(TTOOL_TARGET)/simulators/c++2/src_simulator/arch
	@cp  $(TTOOL_SIMULATORS)/c++2/src_simulator/arch/*.h $(TTOOL_TARGET)/simulators/c++2/src_simulator/arch
	@cp  $(TTOOL_SIMULATORS)/c++2/src_simulator/ebrdd/*.cpp $(TTOOL_TARGET)/simulators/c++2/src_simulator/ebrdd
	@cp  $(TTOOL_SIMULATORS)/c++2/src_simulator/ebrdd/*.h $(TTOOL_TARGET)/simulators/c++2/src_simulator/ebrdd
	@cp  $(TTOOL_SIMULATORS)/c++2/src_simulator/evt/*.cpp $(TTOOL_TARGET)/simulators/c++2/src_simulator/evt
	@cp  $(TTOOL_SIMULATORS)/c++2/src_simulator/evt/*.h $(TTOOL_TARGET)/simulators/c++2/src_simulator/evt
	@cp  $(TTOOL_SIMULATORS)/c++2/src_simulator/sim/*.cpp $(TTOOL_TARGET)/simulators/c++2/src_simulator/sim
	@cp  $(TTOOL_SIMULATORS)/c++2/src_simulator/sim/*.h $(TTOOL_TARGET)/simulators/c++2/src_simulator/sim
	@cp  $(TTOOL_SIMULATORS)/c++2/src_simulator/TEPE/*.cpp $(TTOOL_TARGET)/simulators/c++2/src_simulator/TEPE
	@cp  $(TTOOL_SIMULATORS)/c++2/src_simulator/TEPE/*.h $(TTOOL_TARGET)/simulators/c++2/src_simulator/TEPE
360
# Licenses
Florian Lugou's avatar
Florian Lugou committed
361
	@cp $(RELEASE_STD_FILES_LICENSES) $(TTOOL_TARGET)
362
# Main readme
Florian Lugou's avatar
Florian Lugou committed
363
	@cp $(TTOOL_DOC)/README $(TTOOL_TARGET)
364
#TML
Florian Lugou's avatar
Florian Lugou committed
365 366
	@mkdir -p $(TTOOL_TARGET)/tmlcode
	@cp $(TTOOL_DOC)/README_tml $(TTOOL_TARGET)/tmlcode
367
#UPPAAL
Florian Lugou's avatar
Florian Lugou committed
368 369
	@mkdir -p $(TTOOL_TARGET)/uppaal
	@cp $(TTOOL_DOC)/README_uppaal $(TTOOL_TARGET)/uppaal
370
# Proverif
Florian Lugou's avatar
Florian Lugou committed
371 372 373 374 375
	@mkdir -p $(TTOOL_TARGET)/proverif
	@cp $(TTOOL_DOC)/README_proverif $(TTOOL_TARGET)/proverif
# Graphs
	@mkdir -p $(TTOOL_TARGET)/graphs
	@cp $(TTOOL_DOC)/README_graph $(TTOOL_TARGET)/graphs/
376
# Figure
Florian Lugou's avatar
Florian Lugou committed
377 378
	@mkdir -p $(TTOOL_TARGET)/figures
	@cp $(TTOOL_DOC)/README_figure $(TTOOL_TARGET)/figures
379
# VCD
Florian Lugou's avatar
Florian Lugou committed
380 381
	@mkdir -p $(TTOOL_TARGET)/vcd
	@cp $(TTOOL_DOC)/README_vcd $(TTOOL_TARGET)/vcd
382
# Basic doc
Florian Lugou's avatar
Florian Lugou committed
383 384
	@mkdir -p $(TTOOL_TARGET)/doc
	@cp $(TTOOL_DOC)/README_doc $(TTOOL_TARGET)/doc
385
# AVATAR executable code
Florian Lugou's avatar
Florian Lugou committed
386 387 388
	@mkdir -p $(TTOOL_TARGET)/TToolexecutablecode
	@mkdir -p $(TTOOL_TARGET)/executablecode/src
	@mkdir -p $(TTOOL_TARGET)/executablecode/generated_src
389
	@mkdir -p $(TTOOL_TARGET)/executablecode/example
Florian Lugou's avatar
Florian Lugou committed
390 391 392 393 394 395
	@cp $(TTOOL_EXECUTABLECODE)/Makefile $(TTOOL_TARGET)/executablecode/
	@cp $(TTOOL_EXECUTABLECODE)/Makefile.defs $(TTOOL_TARGET)/executablecode/
	@cp $(TTOOL_EXECUTABLECODE)/Makefile.forsoclib $(TTOOL_TARGET)/executablecode/
	@cp $(TTOOL_EXECUTABLECODE)/src/*.c $(TTOOL_TARGET)/executablecode/src/
	@cp $(TTOOL_EXECUTABLECODE)/src/*.h $(TTOOL_TARGET)/executablecode/src/
	@cp $(TTOOL_EXECUTABLECODE)/generated_src/README $(TTOOL_TARGET)/executablecode/generated_src/
Ludovic Apvrille's avatar
Ludovic Apvrille committed
396 397
	@cp $(TTOOL_EXECUTABLECODE)/example/*.java $(TTOOL_TARGET)/executablecode/example/
	@cp $(TTOOL_EXECUTABLECODE)/example/README $(TTOOL_TARGET)/executablecode/example/
Ludovic Apvrille's avatar
Ludovic Apvrille committed
398
# MPSOC
Florian Lugou's avatar
Florian Lugou committed
399 400 401 402 403 404 405 406 407 408 409 410
	@mkdir -p $(TTOOL_TARGET)/MPSoC
	@mkdir -p $(TTOOL_TARGET)/MPSoC/generated_topcell
	@mkdir -p $(TTOOL_TARGET)/MPSoC/generated_src
	@mkdir -p $(TTOOL_TARGET)/MPSoC/src
	@cp $(TTOOL_MPSOC)/Makefile $(TTOOL_TARGET)/MPSoC/
	@cp $(TTOOL_MPSOC)/Makefile.defs $(TTOOL_TARGET)/MPSoC/
	@cp $(TTOOL_MPSOC)/Makefile.forsoclib $(TTOOL_TARGET)/MPSoC/
	@cp $(TTOOL_MPSOC)/src/*.c $(TTOOL_TARGET)/MPSoC/src/
	@cp $(TTOOL_MPSOC)/src/*.h $(TTOOL_TARGET)/MPSoC/src/
	@cp $(TTOOL_MPSOC)/generated_src/README $(TTOOL_TARGET)/MPSoC/generated_src/
	@cp $(TTOOL_MPSOC)/generated_topcell/nbproc $(TTOOL_TARGET)/MPSoC/generated_topcell/
	@cp $(TTOOL_MPSOC)/generated_topcell/config_noproc $(TTOOL_TARGET)/MPSoC/generated_topcell/
411 412 413 414 415 416 417
#DOC
	@$(MAKE) -C $(TTOOL_DOC_AVATARCODEGENERATION_DIR) codegeneration_documentation
	@cp $(TTOOL_DOC_AVATARCODEGENERATION_DIR)/codegeneration_documentation.pdf  $(TTOOL_TARGET)/doc/avatarcodegeneration_documentation.pdf
	@$(MAKE) -C $(TTOOL_DOC_SOCLIB_USERGUIDE_DIR) user_guide
	@cp $(TTOOL_DOC_SOCLIB_USERGUIDE_DIR)/build/user_guide.pdf  $(TTOOL_TARGET)/doc/prototyping_with_soclib_user_guide.pdf
	@$(MAKE) -C $(TTOOL_DOC_SOCLIB_INSTALLATIONGUIDE_DIR) installation_guide
	@cp $(TTOOL_DOC_SOCLIB_INSTALLATIONGUIDE_DIR)/build/installation_guide.pdf  $(TTOOL_TARGET)/doc/prototyping_with_soclib_installation_guide.pdf
418
# Basic bin
Florian Lugou's avatar
Florian Lugou committed
419 420 421 422 423 424 425 426 427 428 429 430 431 432 433
	@mkdir -p $(TTOOL_TARGET)/bin
	@cp $(TTOOL_DOC)/README_bin $(TTOOL_TARGET)/bin
	@cp $(TTOOL_BIN)/*.jar $(TTOOL_TARGET)/bin
	@mkdir -p $(TTOOL_STD_RELEASE)
	@$(TAR) cf $(BASERELEASE) -C $(TTOOL_TARGET_RELEASE) .

publish_jar: $(TTOOL_BINARY)
	@echo "$(PREFIX) Publishing standard and advanced releases"
	scp $< $(PROD_USERNAME)@$(PROD_ADDRESS):$(PROD_PATH)/
	ssh $(PROD_USERNAME)@$(PROD_ADDRESS) "chmod a+r $(PROD_PATH)/$(notdir $<)"

preinstall: $(TTOOL_PREINSTALL_WINDOWS) $(TTOOL_PREINSTALL_LINUX) $(TTOOL_PREINSTALL_MACOS)
	@echo "$(PREFIX) Publishing preinstall versions"
	scp $^ $(PROD_USERNAME)@$(PROD_ADDRESS):$(PROD_PATH)/

434 435 436 437 438 439 440 441
git:
	@echo "$(PREFIX) Updating build number"
	@date
	git pull
	@$(JAVA) -jar $(BUILDER) $(BUILD_INFO) $(BUILD_TO_MODIFY)
	git commit -m 'update on build version: $(BUILD_INFO)' $(BUILD_INFO) $(BUILD_TO_MODIFY)
	git push

Florian Lugou's avatar
Florian Lugou committed
442 443 444 445
# ======================================== 
# ==========       TESTS        ========== 
# ======================================== 
test:
446
	@$(GRADLE) test
Florian Lugou's avatar
Florian Lugou committed
447 448 449 450

# ======================================== 
# ==========       CLEAN        ========== 
# ======================================== 
451
clean:
Florian Lugou's avatar
Florian Lugou committed
452 453 454 455 456 457 458 459 460 461 462
	@$(MAKE) -C $(TTOOL_DIR) -e clean
	@$(MAKE) -C $(LAUNCHER_DIR) -e clean
	@$(MAKE) -C $(GRAPHMINIMIZE_DIR) -e clean
	@$(MAKE) -C $(GRAPHSHOW_DIR) -e clean
	@$(MAKE) -C $(TIFTRANSLATOR_DIR) -e clean
	@$(MAKE) -C $(TMLTRANSLATOR_DIR) -e clean
	@$(MAKE) -C $(RUNDSE_DIR) -e clean
	@$(MAKE) -C $(REMOTESIMULATOR_DIR) -e clean
	@$(MAKE) -C $(WEBCRAWLER_CLIENT_DIR) -e clean
	@$(MAKE) -C $(WEBCRAWLER_SERVER_DIR) -e clean
	@$(MAKE) -C $(JTTOOL_DIR) -e clean
463 464 465
	@$(MAKE) -C $(TTOOL_DOC_AVATARCODEGENERATION_DIR) clean
	@$(MAKE) -C $(TTOOL_DOC_SOCLIB_USERGUIDE_DIR) clean
	@$(MAKE) -C $(TTOOL_DOC_SOCLIB_INSTALLATIONGUIDE_DIR) clean
Florian Lugou's avatar
Florian Lugou committed
466 467
	@rm -rf $(TTOOL_TARGET_RELEASE)
	@rm -f $(TTOOL_STD_RELEASE)/*.tar
Ludovic Apvrille's avatar
Ludovic Apvrille committed
468

469
ultraclean: clean
Florian Lugou's avatar
Florian Lugou committed
470 471 472
	@rm -rf $(TTOOL_BIN)
	@rm -rf $(TTOOL_DOC_HTML)
	@rm -rf $(TTOOL_STD_RELEASE)