Makefile 25.3 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 9
GRADLE_NO_TEST          = -x test 
GRADLE_OPTIONS          = --parallel
apvrille's avatar
apvrille committed
10
#GRADLE_OPTIONS          =
apvrille's avatar
apvrille committed
11
GRADLE			= $(shell which gradle)
12
GRADLE_VERSION_NEEDED	= 3.3
13
ERROR_MSG		= printf "$(COLOR)\nBuild with gradle failed. Falling back to regular javac command...\n$(RESET)"
14

15
ifeq "$(GRADLE)" ""
16
    ERROR_MSG	= echo "Gradle was not found. Falling back to regular javac command...\n"
17 18
    GRADLE 	= false && echo >/dev/null
else
19
    GRADLE_VERSION 	:= $(shell $(GRADLE) --version | grep "^Gradle" | awk '{print $$2}')
20
    GRADLE_VERSION_MIN 	:= $(shell printf "%s\n%s\n" "$(GRADLE_VERSION_NEEDED)" "$(GRADLE_VERSION)"|sort -n 2>/dev/null|head -n1)
21 22
    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)"
23 24 25
	GRADLE = false && echo >/dev/null
    endif
endif
26 27 28 29

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

Florian Lugou's avatar
Florian Lugou committed
31
export TTOOL_PATH 	:= $(shell /bin/pwd)
Ludovic Apvrille's avatar
Ludovic Apvrille committed
32 33

define HELP_message
34 35 36
Compilation targets:
--------------------
make all                Build TTool and the jar of companion software.
37 38
make ttool		Build TTool only

Ludovic Apvrille's avatar
Ludovic Apvrille committed
39 40

Usual targets:
41 42 43 44 45 46 47 48
--------------
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 !!!
49 50 51
make install		Install TTool, the jar of companion software and the runtime
			dependencies to $$DESTDIR/bin. By default, install to
			$(TTOOL_PATH)/bin.
52 53
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
54

55
make ttooljavac		Build TTool only with javac
Ludovic Apvrille's avatar
Ludovic Apvrille committed
56
make ttoolnotest	Build TTool with gradle, but do not execute test. Performs the install
57
make allnotest		Builld all apps, but do not execute tests. Performs the install
apvrille's avatar
apvrille committed
58
make internalhelp		Generate the help of TTool in HTML format
59 60


Ludovic Apvrille's avatar
Ludovic Apvrille committed
61 62
Other targets:
--------------
63
make preinstall		Generate a preinstall version of TTool for Linux, Windows and
64
			MacOS and publish them on the website of TTool (hidden link)
65 66
			!!! Must have the right ssh key installed for this !!!
make git		Update the build number.
Ludovic Apvrille's avatar
Ludovic Apvrille committed
67 68 69


Please report bugs or suggestions of improvements to:
apvrille's avatar
apvrille committed
70
  ttool.telecom-paristech.fr/support.html
Ludovic Apvrille's avatar
Ludovic Apvrille committed
71 72 73
endef
export HELP_message

74
.PHONY: ttool clean launcher graphminimize graphshow ttool-cli tiftranslator tmltranslator rundse remotesimulator webcrawler documentation help ultraclean publish_jar preinstall test git
Ludovic Apvrille's avatar
Ludovic Apvrille committed
75 76 77 78

help:
	@echo "$$HELP_message"

Florian Lugou's avatar
Florian Lugou committed
79
FORCE:
Ludovic Apvrille's avatar
Ludovic Apvrille committed
80

Florian Lugou's avatar
Florian Lugou committed
81 82 83 84
# ======================================== 
# ========== SUB-PROJECTS BUILD ========== 
# ======================================== 
export TTOOL_SRC 		= $(TTOOL_PATH)/src/main/java
Florian Lugou's avatar
Florian Lugou committed
85
export GLOBAL_JAVA		= $(shell cd $(TTOOL_SRC); find . -name "[^.]*.java")
Florian Lugou's avatar
Florian Lugou committed
86 87
export TTOOL_RESOURCES		= $(TTOOL_PATH)/src/main/resources
export TTOOL_WEBCRAWLER_SRC 	= $(TTOOL_PATH)/src/main/java/web/crawler
88
export TTOOL_BUILD		= $(TTOOL_PATH)/build
Florian Lugou's avatar
Florian Lugou committed
89 90 91
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
92

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

Florian Lugou's avatar
Florian Lugou committed
95
export TTOOL_DIR		= $(TTOOL_PATH)/ttool
96
export TTOOL_BINARY 		= $(TTOOL_BUILD)/ttool.jar
Ludovic Apvrille's avatar
Ludovic Apvrille committed
97

Florian Lugou's avatar
Florian Lugou committed
98
export LAUNCHER_DIR		= $(TTOOL_PATH)/launcher
99
export LAUNCHER_BINARY 		= $(TTOOL_BUILD)/launcher.jar
100

101 102 103
export TTOOLCLI_DIR	= $(TTOOL_PATH)/ttool-cli
export TTOOLCLI_BINARY 	= $(TTOOL_BUILD)/ttool-cli.jar

Florian Lugou's avatar
Florian Lugou committed
104
export GRAPHMINIMIZE_DIR	= $(TTOOL_PATH)/graphminimize
105
export GRAPHMINIMIZE_BINARY 	= $(TTOOL_BUILD)/graphminimize.jar
106

Florian Lugou's avatar
Florian Lugou committed
107
export GRAPHSHOW_DIR		= $(TTOOL_PATH)/graphshow
108
export GRAPHSHOW_BINARY 	= $(TTOOL_BUILD)/graphshow.jar
109

Florian Lugou's avatar
Florian Lugou committed
110
export TIFTRANSLATOR_DIR	= $(TTOOL_PATH)/tiftranslator
111
export TIFTRANSLATOR_BINARY 	= $(TTOOL_BUILD)/tiftranslator.jar
112

Florian Lugou's avatar
Florian Lugou committed
113
export TMLTRANSLATOR_DIR	= $(TTOOL_PATH)/tmltranslator
114
export TMLTRANSLATOR_BINARY 	= $(TTOOL_BUILD)/tmltranslator.jar
Ludovic Apvrille's avatar
Ludovic Apvrille committed
115

Florian Lugou's avatar
Florian Lugou committed
116
export RUNDSE_DIR		= $(TTOOL_PATH)/rundse
117
export RUNDSE_BINARY 		= $(TTOOL_BUILD)/rundse.jar
118

Florian Lugou's avatar
Florian Lugou committed
119
export REMOTESIMULATOR_DIR	= $(TTOOL_PATH)/simulationcontrol
120
export REMOTESIMULATOR_BINARY 	= $(TTOOL_BUILD)/simulationcontrol.jar
121

Florian Lugou's avatar
Florian Lugou committed
122
export WEBCRAWLER_CLIENT_DIR	= $(TTOOL_PATH)/webcrawler/client
123
export WEBCRAWLER_CLIENT_BINARY	= $(TTOOL_BUILD)/webcrawler-client.jar
124

Florian Lugou's avatar
Florian Lugou committed
125
export WEBCRAWLER_SERVER_DIR	= $(TTOOL_PATH)/webcrawler/server
126
export WEBCRAWLER_SERVER_BINARY	= $(TTOOL_BUILD)/webcrawler-server.jar
127

Florian Lugou's avatar
Florian Lugou committed
128
export JTTOOL_DIR		= $(TTOOL_PATH)/jttool
129
export JTTOOL_BINARY		= $(TTOOL_BUILD)/jttool.jar
130

131 132 133 134
export TTOOL_HELP_DIR	= $(TTOOL_PATH)/src/main/resources/help
MD_FILES=$(wildcard src/main/resources/help/*.md)	
MD2HTML=$(MD_FILES:.md=.html)

135 136 137
all: ttool launcher ttool-cli graphminimize graphshow tiftranslator tmltranslator rundse remotesimulator webcrawler install

allnotest: GRADLE_OPTIONS += $(GRADLE_NO_TEST)
Ludovic Apvrille's avatar
Ludovic Apvrille committed
138
allnotest: ttool launcher ttool-cli graphminimize graphshow tiftranslator tmltranslator rundse remotesimulator webcrawler install
139

Ludovic Apvrille's avatar
Ludovic Apvrille committed
140 141 142
ttoolnotest: GRADLE_OPTIONS += $(GRADLE_NO_TEST)
ttoolnotest: ttool install

Florian Lugou's avatar
Florian Lugou committed
143
ttool: $(TTOOL_BINARY)
144
ttoolnotest: 
145

Florian Lugou's avatar
Florian Lugou committed
146
$(TTOOL_BINARY): FORCE
147
	@($(GRADLE) :ttool:build $(GRADLE_OPTIONS)) || ($(ERROR_MSG) $(GRADLE_VERSION) $(GRADLE_VERSION_NEEDED)&& $(MAKE) -C $(TTOOL_DIR) -e $@)
148

149

150
ttooljavac: 
151
	$(MAKE) -C $(TTOOL_DIR)
Ludovic Apvrille's avatar
Ludovic Apvrille committed
152
	$(MAKE) -C $(TTOOLCLI_DIR)
153

Florian Lugou's avatar
Florian Lugou committed
154
launcher: $(LAUNCHER_BINARY)
155

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

159 160 161
ttool-cli: $(TTOOLCLI_BINARY)

$(TTOOLCLI_BINARY): FORCE
162
	@($(GRADLE) :ttool-cli:build $(GRADLE_OPTIONS)) || ($(ERROR_MSG) && $(MAKE) -C $(TTOOLCLI_DIR) -e $@)
163

Florian Lugou's avatar
Florian Lugou committed
164
graphminimize: $(GRAPHMINIMIZE_BINARY)
165

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

Florian Lugou's avatar
Florian Lugou committed
169
graphshow: $(GRAPHSHOW_BINARY)
170

Florian Lugou's avatar
Florian Lugou committed
171
$(GRAPHSHOW_BINARY): FORCE
172
	@($(GRADLE) :graphshow:build) || ($(ERROR_MSG) && $(MAKE) -C $(GRAPHSHOW_DIR) -e $@)
Florian Lugou's avatar
Florian Lugou committed
173 174 175 176

tiftranslator: $(TIFTRANSLATOR_BINARY)

$(TIFTRANSLATOR_BINARY): FORCE
177
	@($(GRADLE) :tiftranslator:build) || ($(ERROR_MSG) && $(MAKE) -C $(TIFTRANSLATOR_DIR) -e $@)
Florian Lugou's avatar
Florian Lugou committed
178 179 180 181

tmltranslator: $(TMLTRANSLATOR_BINARY)

$(TMLTRANSLATOR_BINARY): FORCE
182
	@($(GRADLE) :tmltranslator:build) || ($(ERROR_MSG) && $(MAKE) -C $(TMLTRANSLATOR_DIR) -e $@)
Florian Lugou's avatar
Florian Lugou committed
183 184 185 186

rundse: $(RUNDSE_BINARY)

$(RUNDSE_BINARY): FORCE
187
	@($(GRADLE) :rundse:build) || ($(ERROR_MSG) && $(MAKE) -C $(RUNDSE_DIR) -e $@)
Florian Lugou's avatar
Florian Lugou committed
188 189 190 191

remotesimulator: $(REMOTESIMULATOR_BINARY)

$(REMOTESIMULATOR_BINARY): FORCE
192
	@($(GRADLE) :simulationcontrol:build) || ($(ERROR_MSG) && $(MAKE) -C $(REMOTESIMULATOR_DIR) -e $@)
Florian Lugou's avatar
Florian Lugou committed
193 194 195 196

webcrawler: $(WEBCRAWLER_CLIENT_BINARY) $(WEBCRAWLER_SERVER_BINARY)

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

$(WEBCRAWLER_SERVER_BINARY): FORCE
200
	@($(GRADLE) :webcrawler-server:build) || ($(ERROR_MSG) && $(MAKE) -C $(WEBCRAWLER_SERVER_DIR) -e $@)
Florian Lugou's avatar
Florian Lugou committed
201

Ludovic Apvrille's avatar
Ludovic Apvrille committed
202 203
#$(JTTOOL_BINARY): FORCE
#	@$(MAKE) -C $(JTTOOL_DIR) -e $@
Florian Lugou's avatar
Florian Lugou committed
204

205

apvrille's avatar
apvrille committed
206
internalhelp: html
207 208 209 210

html: $(MD2HTML)

%.html: %.md
211
	pandoc $< -f markdown -t html -s -o  $@ --lua-filter=doc/ttoolfilter.lua --metadata pagetitle="TTool help"
212

Florian Lugou's avatar
Florian Lugou committed
213 214 215 216 217 218
# ======================================== 
# ==========    DOCUMENTATION   ========== 
# ======================================== 
TTOOL_DOC			= $(TTOOL_PATH)/doc
export TTOOL_DOC_HTML 		= $(TTOOL_DOC)/html

219
DOCFLAGS			= -encoding "UTF8" -quiet -J-Xmx256m -classpath $(TTOOL_CLASSPATH) -d $(TTOOL_DOC_HTML)
Florian Lugou's avatar
Florian Lugou committed
220 221 222 223 224 225 226 227 228

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

# ======================================== 
# ==========      RELEASES      ========== 
# ======================================== 
TTOOL_PRIVATE 			?= $(TTOOL_PATH)/../TTool-Private
229 230
TTOOL_PRIVATE_RELEASES 			?= $(TTOOL_PRIVATE)/website/ttool/releases

Florian Lugou's avatar
Florian Lugou committed
231 232 233 234 235

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

236
TTOOL_DOC_SYSMLSEC_DIR		 	= $(TTOOL_DOC)/SysMLSec
237
TTOOL_DOC_AVATARCODEGENERATION_DIR 	= $(TTOOL_DOC)/codegeneration
238
TTOOL_DOC_SOCLIB_USERGUIDE_DIR 		= $(TTOOL_DOC)/documents_soclib/USER_GUIDE
apvrille's avatar
apvrille committed
239
TTOOL_DOC_SOCLIB_INSTALLATIONGUIDE_DIR 	= $(TTOOL_DOC)/documents_soclib/INSTALLATION_GUIDE
240

Florian Lugou's avatar
Florian Lugou committed
241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259
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

260 261 262 263
BUILDER			= $(TTOOL_PATH)/builder.jar
BUILD_INFO		= build.txt
BUILD_TO_MODIFY		= $(TTOOL_SRC)/ui/util/DefaultText.java

264
TTOOL_LOTOS_H		= $(patsubst $(TTOOL_DIR)/runtime/%,$(TTOOL_BUILD)/%,$(wildcard $(TTOOL_DIR)/runtime/spec*))
Florian Lugou's avatar
Florian Lugou committed
265 266 267 268 269 270 271 272 273 274 275 276 277

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 \
			  AVATAR/CoffeeMachine_Avatar.xml \
			  AVATAR/Network_Avatar.xml \
			  AVATAR/MicroWaveOven_SafetySecurity_fullMethodo.xml)
RELEASE_STD_FILES_LIB 	= $(patsubst %,$(TTOOL_MODELING)/%,\
			  TURTLE/TClock1.lib \
278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296
                          DIPLODOCUS/CPlibrary/ConfigPollingDMA_SD.lib\
                          DIPLODOCUS/CPlibrary/ConfigureDMA_SD.lib\
                          DIPLODOCUS/CPlibrary/DMACycle_SD.lib\
                          DIPLODOCUS/CPlibrary/DMAPollingCycleP_AD.lib\
                          DIPLODOCUS/CPlibrary/DMATransfer_NoPolling_MainCP.lib\
                          DIPLODOCUS/CPlibrary/DMATransfer_Polling_MainCP.lib\
                          DIPLODOCUS/CPlibrary/DMATransferCycleP_AD.lib\
                          DIPLODOCUS/CPlibrary/DMATransferCycleP_SD.lib\
                          DIPLODOCUS/CPlibrary/EnableFlag_SD.lib\
                          DIPLODOCUS/CPlibrary/LoadCPU_LoadConfigureSD.lib\
                          DIPLODOCUS/CPlibrary/LoadCPU_LoadTransferCycleSD.lib\
                          DIPLODOCUS/CPlibrary/LoadCPU_mainCP.lib\
                          DIPLODOCUS/CPlibrary/PollingCycle_SD.lib\
                          DIPLODOCUS/CPlibrary/StoreCPU_mainCP.lib\
                          DIPLODOCUS/CPlibrary/StoreCPU_StoreConfigureSD.lib\
                          DIPLODOCUS/CPlibrary/StoreCPU_StoreTransferCycleSD.lib\
                          DIPLODOCUS/CPlibrary/TerminateDMA_SD.lib\
                          DIPLODOCUS/StoreCPU_StoreConfigureCycleSD.lib\
			  TURTLE/TTimerv01.lib) 
Florian Lugou's avatar
Florian Lugou committed
297 298 299 300 301 302 303 304 305 306 307 308 309
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)

310 311
release: $(STDRELEASE)
#$(ADVANCED_RELEASE)
Florian Lugou's avatar
Florian Lugou committed
312 313 314 315 316 317 318

$(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
319
# LOTOS
Florian Lugou's avatar
Florian Lugou committed
320 321
	@mkdir -p $(TTOOL_TARGET)/lotos
	@cp $(TTOOL_DOC)/README_lotos $(TTOOL_TARGET)/lotos
Ludovic Apvrille's avatar
Ludovic Apvrille committed
322
#NC
Florian Lugou's avatar
Florian Lugou committed
323 324 325 326 327 328
	@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
Ludovic Apvrille's avatar
Ludovic Apvrille committed
329 330 331
#	@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
332
# Basic bin
Florian Lugou's avatar
Florian Lugou committed
333
	@cp $(TTOOL_EXE) $(TTOOL_TARGET)/
334
	@cp $(TTOOL_CONFIG_SRC) $(TTOOL_TARGET)/bin
Florian Lugou's avatar
Florian Lugou committed
335
	@cp $(TTOOL_LOTOS_H) $(TTOOL_TARGET)/bin
336
	@$(TAR) uf $@ -C $(TTOOL_TARGET_RELEASE) TTool/lotos TTool/nc TTool/bin 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
337 338 339 340 341 342 343 344 345

$(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
346
	@cp -r $(TTOOLCLI_DIR)/src/main/java/* $(TTOOL_TARGET)/src
Florian Lugou's avatar
Florian Lugou committed
347 348 349 350 351 352 353 354 355
	@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 {} \;
356
	@cp $(TTOOL_DOC)/README_src $(TTOOL_TARGET)/src
Florian Lugou's avatar
Florian Lugou committed
357 358 359 360 361 362 363 364
	@$(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)
365 366
	@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
apvrille's avatar
apvrille committed
367
	@cp $(TTOOL_PATH)/build/*.jar $(TTOOL_TARGET_WINDOWS)/TTool/bin/
368
	@$(TAR) uf $@ -C $(TTOOL_TARGET_WINDOWS) proverif uppaal TTool/bin/config_windows.xml ttool.bat
Florian Lugou's avatar
Florian Lugou committed
369 370 371 372 373 374 375 376

$(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
377 378
	@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
379
	@chmod u+x $(TTOOL_TARGET_MACOS)/ttool.exe
apvrille's avatar
apvrille committed
380
	@cp $(TTOOL_PATH)/build/*.jar $(TTOOL_TARGET_MACOS)/TTool/bin/
381
	@$(TAR) uf $@ -C $(TTOOL_TARGET_MACOS) proverif uppaal TTool/bin/config_macosx.xml ttool.exe
Florian Lugou's avatar
Florian Lugou committed
382 383 384 385 386 387 388

$(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)
389 390
	@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
391
	@chmod u+x $(TTOOL_TARGET_LINUX)/ttool.exe
apvrille's avatar
apvrille committed
392
	@cp $(TTOOL_PATH)/build/*.jar $(TTOOL_TARGET_LINUX)/TTool/bin/
393
	@$(TAR) uf $@ -C $(TTOOL_TARGET_LINUX) proverif uppaal TTool/bin/config_linux.xml ttool.exe
Florian Lugou's avatar
Florian Lugou committed
394

395 396
#$(BASERELEASE:.tgz=.tar): $(JTTOOL_BINARY) $(TTOOL_BINARY) $(LAUNCHER_BINARY $(TIFTRANSLATOR_BINARYT) $(TMLTRANSLATOR_BINARY) $(RUNDSE_BINARY) FORCE
$(BASERELEASE:.tgz=.tar): allnotest
Florian Lugou's avatar
Florian Lugou committed
397
	@echo "$(PREFIX) Preparing base release"
398
	@rm -rf $(TTOOL_TARGET_RELEASE)
Florian Lugou's avatar
Florian Lugou committed
399 400 401 402 403
	@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
404
# lib
Florian Lugou's avatar
Florian Lugou committed
405 406 407
	@mkdir -p $(TTOOL_TARGET)/lib
	@cp $(RELEASE_STD_FILES_LIB) $(TTOOL_TARGET)/lib
	@cp $(TTOOL_DOC)/README_lib $(TTOOL_TARGET)/lib
408
# DIPLODOCUS simulators
Florian Lugou's avatar
Florian Lugou committed
409 410 411 412 413 414 415 416 417 418 419 420
	@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
421
	@cp  $(TTOOL_SIMULATORS)/c++2/src_simulator/*.js $(TTOOL_TARGET)/simulators/c++2/src_simulator
Florian Lugou's avatar
Florian Lugou committed
422 423 424 425 426 427 428 429 430 431 432 433
	@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
434
# Licenses
Florian Lugou's avatar
Florian Lugou committed
435
	@cp $(RELEASE_STD_FILES_LICENSES) $(TTOOL_TARGET)
436
# Main readme
Florian Lugou's avatar
Florian Lugou committed
437
	@cp $(TTOOL_DOC)/README $(TTOOL_TARGET)
438
#TML
Florian Lugou's avatar
Florian Lugou committed
439 440
	@mkdir -p $(TTOOL_TARGET)/tmlcode
	@cp $(TTOOL_DOC)/README_tml $(TTOOL_TARGET)/tmlcode
441
#UPPAAL
Florian Lugou's avatar
Florian Lugou committed
442 443
	@mkdir -p $(TTOOL_TARGET)/uppaal
	@cp $(TTOOL_DOC)/README_uppaal $(TTOOL_TARGET)/uppaal
444
# Proverif
Florian Lugou's avatar
Florian Lugou committed
445 446 447 448 449
	@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/
450
# Figure
Florian Lugou's avatar
Florian Lugou committed
451 452
	@mkdir -p $(TTOOL_TARGET)/figures
	@cp $(TTOOL_DOC)/README_figure $(TTOOL_TARGET)/figures
453
# VCD
Florian Lugou's avatar
Florian Lugou committed
454 455
	@mkdir -p $(TTOOL_TARGET)/vcd
	@cp $(TTOOL_DOC)/README_vcd $(TTOOL_TARGET)/vcd
456
# Basic doc
Florian Lugou's avatar
Florian Lugou committed
457 458
	@mkdir -p $(TTOOL_TARGET)/doc
	@cp $(TTOOL_DOC)/README_doc $(TTOOL_TARGET)/doc
459
# AVATAR executable code
apvrille's avatar
apvrille committed
460
	@mkdir -p $(TTOOL_TARGET)/executablecode
Florian Lugou's avatar
Florian Lugou committed
461 462
	@mkdir -p $(TTOOL_TARGET)/executablecode/src
	@mkdir -p $(TTOOL_TARGET)/executablecode/generated_src
463
	@mkdir -p $(TTOOL_TARGET)/executablecode/example
464
	@cp $(TTOOL_EXECUTABLECODE)/LICENSE* $(TTOOL_TARGET)/executablecode/
Florian Lugou's avatar
Florian Lugou committed
465 466 467 468 469 470
	@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
471 472
	@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
473
# MPSOC
474 475 476 477 478 479 480 481 482 483 484 485
#	@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/
486
#DOC
487 488 489
	@$(MAKE) -C $(TTOOL_DOC_SYSMLSEC_DIR) sysmlsec_documentation
	@cp $(TTOOL_DOC_SYSMLSEC_DIR)/build/sysmlsec_documentation.pdf  $(TTOOL_TARGET)/doc/sysmlsec_documentation.pdf
	@cp $(TTOOL_DOC_SYSMLSEC_DIR)/build/sysmlsec_documentation.pdf  $(TTOOL_PRIVATE)/website/ttool/docs/
490
	@$(MAKE) -C $(TTOOL_DOC_AVATARCODEGENERATION_DIR) codegeneration_documentation
491 492
	@cp $(TTOOL_DOC_AVATARCODEGENERATION_DIR)/build/codegeneration_documentation.pdf  $(TTOOL_TARGET)/doc/avatarcodegeneration_documentation.pdf
	@cp $(TTOOL_DOC_AVATARCODEGENERATION_DIR)/build/codegeneration_documentation.pdf  $(TTOOL_PRIVATE)/website/ttool/docs/
493 494 495 496
	@$(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
497
# Basic bin
Florian Lugou's avatar
Florian Lugou committed
498 499
	@mkdir -p $(TTOOL_TARGET)/bin
	@cp $(TTOOL_DOC)/README_bin $(TTOOL_TARGET)/bin
500
	@cp $(TTOOL_BUILD)/*.jar $(TTOOL_TARGET)/bin
Florian Lugou's avatar
Florian Lugou committed
501 502 503 504 505
	@mkdir -p $(TTOOL_STD_RELEASE)
	@$(TAR) cf $(BASERELEASE) -C $(TTOOL_TARGET_RELEASE) .

publish_jar: $(TTOOL_BINARY)
	@echo "$(PREFIX) Publishing standard and advanced releases"
506 507 508
#	scp $< $(PROD_USERNAME)@$(PROD_ADDRESS):$(PROD_PATH)/
#	ssh $(PROD_USERNAME)@$(PROD_ADDRESS) "chmod a+r $(PROD_PATH)/$(notdir $<)"
	cp $< $(TTOOL_PRIVATE_RELEASES)/
Florian Lugou's avatar
Florian Lugou committed
509 510 511

preinstall: $(TTOOL_PREINSTALL_WINDOWS) $(TTOOL_PREINSTALL_LINUX) $(TTOOL_PREINSTALL_MACOS)
	@echo "$(PREFIX) Publishing preinstall versions"
512 513 514
#	scp $^ $(PROD_USERNAME)@$(PROD_ADDRESS):$(PROD_PATH)/
	cp $^ $(TTOOL_PRIVATE_RELEASES)/
	cd $(TTOOL_PRIVATE)/website&&make ttool
Florian Lugou's avatar
Florian Lugou committed
515

516 517 518 519 520 521 522 523
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

524 525 526 527 528 529
# ======================================== 
# ==========      INSTALL       ========== 
# ======================================== 

DESTDIR ?= $(TTOOL_PATH)

530 531
install:
#ttool launcher graphminimize graphshow tiftranslator tmltranslator rundse remotesimulator webcrawler
532
	mkdir -p $(DESTDIR)/bin
533
	@cp $(TTOOL_BUILD)/*.jar $(TTOOL_BUILD)/*.xml $(TTOOL_BUILD)/*.h $(TTOOL_BUILD)/*.f  $(TTOOL_BUILD)/*.t $(TTOOL_BUILD)/*.exe  $(DESTDIR)/bin
534

Florian Lugou's avatar
Florian Lugou committed
535 536 537 538
# ======================================== 
# ==========       TESTS        ========== 
# ======================================== 
test:
539
	@$(GRADLE) test
Florian Lugou's avatar
Florian Lugou committed
540 541 542 543

# ======================================== 
# ==========       CLEAN        ========== 
# ======================================== 
544
clean:
Florian Lugou's avatar
Florian Lugou committed
545 546
	@$(MAKE) -C $(TTOOL_DIR) -e clean
	@$(MAKE) -C $(LAUNCHER_DIR) -e clean
547
	@$(MAKE) -C $(TTOOLCLI_DIR) -e clean
Florian Lugou's avatar
Florian Lugou committed
548 549 550 551 552 553 554 555 556
	@$(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
557
	@$(MAKE) -C $(TTOOL_DOC_SYSMLSEC_DIR) clean	
558 559 560
	@$(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
561 562
	@rm -rf $(TTOOL_TARGET_RELEASE)
	@rm -f $(TTOOL_STD_RELEASE)/*.tar
563 564
	@rm -rf $(TTOOL_BUILD)
	@rm -rf $(TTOOL_DIR)/build/
Ludovic Apvrille's avatar
Ludovic Apvrille committed
565

566
ultraclean: clean
Florian Lugou's avatar
Florian Lugou committed
567 568
	@rm -rf $(TTOOL_DOC_HTML)
	@rm -rf $(TTOOL_STD_RELEASE)