-
Notifications
You must be signed in to change notification settings - Fork 40
/
Makefile
106 lines (92 loc) · 3.08 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
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
101
102
103
104
105
106
#
# Copyright (C) 2013-2023 Christoph Sommer <[email protected]>
#
# Documentation for these modules is at http://veins.car2x.org/
#
# SPDX-License-Identifier: GPL-2.0-or-later
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
.PHONY: all makefiles clean cleanall doxy formatting formatting-strict
# if out/config.py exists, we can also create command line scripts for running simulations
ADDL_TARGETS =
ifeq ($(wildcard out/config.py),)
else
ADDL_TARGETS += bin/plexe_run
endif
# default target
all: src/Makefile $(ADDL_TARGETS)
ifdef MODE
@cd src && $(MAKE)
else
@cd src && $(MAKE) MODE=release
@cd src && $(MAKE) MODE=debug
endif
# command line scripts
bin/plexe_run: src/scripts/plexe_run.in.py out/config.py
@echo "Creating script \"$@\""
@sed '/# v-- contents of out\/config.py go here/r out/config.py' "$<" > "$@"
@chmod a+x "$@"
# legacy
makefiles:
@echo
@echo '====================================================================='
@echo 'Warning: make makefiles has been deprecated in favor of ./configure'
@echo '====================================================================='
@echo
./configure
@echo
@echo '====================================================================='
@echo 'Warning: make makefiles has been deprecated in favor of ./configure'
@echo '====================================================================='
@echo
clean: src/Makefile
ifdef MODE
@cd src && $(MAKE) clean
else
@cd src && $(MAKE) MODE=release clean
@cd src && $(MAKE) MODE=debug clean
endif
cleanall: clean
rm -f src/Makefile
rm -f out/config.py
rm -f bin/plexe_run
src/Makefile:
@echo
@echo '====================================================================='
@echo '$@ does not exist.'
@echo 'Please run "./configure" or use the OMNeT++ IDE to generate it.'
@echo '====================================================================='
@echo
@exit 1
out/config.py:
@echo
@echo '====================================================================='
@echo '$@ does not exist.'
@echo 'Please run "./configure" to generate it.'
@echo '====================================================================='
@echo
@exit 1
# autogenerated documentation
doxy:
PLEXE_VERSION=$(shell doc/version.sh) doxygen doxy.cfg
doxyshow: doxy
xdg-open doc/doxy/index.html
formatting:
bin/plexe_format_code src
bin/plexe_format_code subprojects
formatting-strict:
bin/plexe_format_code --strict src
bin/plexe_format_code --strict subprojects