Makefile.common 2.96 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
############################################################################
# Common makefile for PolyORB HI
#
# $Id: Makefile.common 7007 2009-09-18 22:21:47Z lanarre $

############################################################################
# Default rule
#

all-local:
	@echo "TO BUILD THE EXAMPLE, YOU SHOULD ISSUE '$(MAKE) build-all'"

build-all:
	if test ! "$(SCENARIO_FILES)" = "";  then \
	   $(MAKE) scenarios; \
	elif test ! "$(SCENARIO_FILE)" = ""; then \
	   $(MAKE) scenario; \
	else \
	   echo "No scenario files, nothing to be done"; \
20
	fi
21

22
23
24
25
26
27
28
29
30
31
32
33
check-all: build-all

# XXX the following has been disabled due to issue with the execution
# of test programs by emulators
#
#	if test ! "$(CHECKABLE_SCENARIO_FILES)" = "";  then \
#           $(MAKE) scenarios-check; \
#        elif test ! "$(CHECKABLE_SCENARIO_FILE)" = ""; then \
#           $(MAKE) scenario-check; \
#        else \
#           echo "No scenario files, nothing to be done"; \
#        fi
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100


############################################################################
# Code generation from AADL
#

scenarios:
	@echo "********* SCENARIO_FILES = $(SCENARIO_FILES) *********";
	for sc in $(SCENARIO_FILES); do \
	  $(MAKE) SCENARIO_FILE=$${sc} SCENARIO_FILES="" build-all || exit 1; \
	done;

scenario:
	@echo "*********  SCENARIO_FILE = $(SCENARIO_FILE)  *********";
	ocarina -b -x '${shell $(CYGPATH_W) $(SCENARIO_FILE)}';

############################################################################
# Code generation and execution from AADL
#

scenarios-check:
	@echo "********* SCENARIO_FILES = $(CHECKABLE_SCENARIO_FILES) *********";
	for sc in $(CHECKABLE_SCENARIO_FILES); do \
          $(MAKE) CHECKABLE_SCENARIO_FILE=$${sc} CHECKABLE_SCENARIO_FILES="" check-all || exit 1; \
        done;

scenario-check:
	@echo "********* SCENARIO_FILE = $(CHECKABLE_SCENARIO_FILE) *********";
	ocarina -b -er -x '${shell $(CYGPATH_W) $(CHECKABLE_SCENARIO_FILE)}';


############################################################################
# Installation rule
#

SAMPLE_NAME = $(subst examples/,,$(subdir))
SAMPLE_DIR  = ${shell $(CYGPATH_U) '$(OCARINA_PREFIX)/examples/ocarina/polyorb-hi-ada/$(SAMPLE_NAME)'}

install-data-local:
	$(INSTALL) -d $(DESTDIR)$(SAMPLE_DIR)
	if [ -r $(srcdir)/README ]; then \
	  $(INSTALL_DATA) $(srcdir)/README $(DESTDIR)$(SAMPLE_DIR); \
	fi
	for f in $(EXTRA_DIST); do \
	  $(INSTALL_DATA) $$f $(DESTDIR)$(SAMPLE_DIR); \
	done

############################################################################
# clean rule
#

clean-local:
	@-rm -f *~ *.o *.al temp.* *.metrix *.trace *.trace.list *.html xcov.css gnatcheck.out log_ocarina log.*.ref.txt log.*.trace.txt
	if test ! "$(CLEANDIRS)" = "";  then \
	   rm -rf $(CLEANDIRS); \
	fi

############################################################################
# Debug stuff
#

debug-makefile:
	@echo "SAMPLE_NAME    = $(SAMPLE_NAME)"
	@echo "SAMPLE_DIR     = $(SAMPLE_DIR)"
	@echo "SCENARIO_FILES = $(SCENARIO_FILES)"
	@echo "SCENARIO_FILE  = $(SCENARIO_FILE)"