forked from gridlab-d/gridlab-d
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile.am
325 lines (290 loc) · 13.1 KB
/
Makefile.am
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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
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
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
# $Id: Makefile.am 4738 2014-07-03 00:55:39Z dchassin $
# Copyright (C) 2008 Battelle Memorial Institute
# This file is distributed under the same terms as GridLAB-D.
ACLOCAL_AMFLAGS = -I m4
CC = $(PTHREAD_CC)
CXX = $(PTHREAD_CXX)
AM_CPPFLAGS =
AM_CPPFLAGS += -I$(top_srcdir)/gldcore
AM_CPPFLAGS += $(GLD_CPPFLAGS)
AM_CFLAGS =
AM_CFLAGS += $(PTHREAD_CFLAGS)
AM_CFLAGS += $(GLD_CFLAGS)
AM_CXXFLAGS =
AM_CXXFLAGS += $(PTHREAD_CFLAGS)
AM_CXXFLAGS += $(GLD_CXXFLAGS)
AM_LDFLAGS =
AM_LDFLAGS += -no-undefined
AM_LDFLAGS += -module
AM_LDFLAGS += -avoid-version
AM_LDFLAGS += -export-dynamic
AM_LDFLAGS += $(GLD_LDFLAGS)
# These are temporary additions that should be removed or moved elsewhere once the build compiles
if HAVE_MINGW
AM_LDFLAGS += -lws2_32
AM_LDFLAGS += -Xlinker --allow-multiple-definition
endif
# makefile fragments populate these variables
BUILT_SOURCES =
CLEANFILES =
EXTRA_DIST =
dist_pkgdata_DATA =
pkgdata_DATA =
noinst_LTLIBRARIES =
pkglib_LTLIBRARIES =
bin_PROGRAMS =
bin_SCRIPTS =
dist_doc_DATA =
# we're using non-recursive Make
# include Makefile fragments instead of using SUBDIRS
include assert/Makefile.mk
include climate/Makefile.mk
include commercial/Makefile.mk
#include rest/Makefile.mk
#include comm/Makefile.mk
include connection/Makefile.mk
#include control/Makefile.mk
include gldcore/link/engine/Makefile.mk
include gldcore/link/matlab/Makefile.mk
include gldcore/Makefile.mk
include gldcore/rt/Makefile.mk
include gldcore/solvers/Makefile.mk
#include debug/Makefile.mk
include generators/Makefile.mk
include market/Makefile.mk
#include matlab/Makefile.mk
include mysql/Makefile.mk
#include network/Makefile.mk
include optimize/Makefile.mk
#include plc/Makefile.mk
include powerflow/Makefile.mk
include reliability/Makefile.mk
include residential/Makefile.mk
include tape_file/Makefile.mk
include tape/Makefile.mk
include tape_plot/Makefile.mk
# we combine the sources in CBLAS and superLU_MT in a single Makefile fragment
include third_party/superLU_MT/Makefile_combined.mk
#include third_party/CBLAS/Makefile.mk
#include third_party/superLU_MT/Makefile.mk
# for doxygen commands
include aminclude.mk
dist_doc_DATA += COPYRIGHT
dist_doc_DATA += LICENSE
EXTRA_DIST += $(top_srcdir)/debian/changelog
EXTRA_DIST += $(top_srcdir)/debian/compat
EXTRA_DIST += $(top_srcdir)/debian/control
EXTRA_DIST += $(top_srcdir)/debian/copyright
EXTRA_DIST += $(top_srcdir)/debian/docs
EXTRA_DIST += $(top_srcdir)/debian/gridlabd-dev.install
EXTRA_DIST += $(top_srcdir)/debian/gridlabd.install
EXTRA_DIST += $(top_srcdir)/debian/rules*
EXTRA_DIST += $(top_srcdir)/doxygen/build.bat
EXTRA_DIST += $(top_srcdir)/doxygen/COPYRIGHT
EXTRA_DIST += $(top_srcdir)/doxygen/doxygen-doc.vcproj
EXTRA_DIST += $(top_srcdir)/doxygen/footer.html
EXTRA_DIST += $(top_srcdir)/doxygen/gridlabd.conf
EXTRA_DIST += $(top_srcdir)/doxygen/LICENSE
EXTRA_DIST += $(top_srcdir)/doxygen/STATUS
EXTRA_DIST += $(top_srcdir)/doxygen/user_manual.h
EXTRA_DIST += $(top_srcdir)/gridlabd.spec
EXTRA_DIST += $(top_srcdir)/README-LINUX
EXTRA_DIST += $(top_srcdir)/README-MACOSX
EXTRA_DIST += $(top_srcdir)/Resources/Background.png
EXTRA_DIST += $(top_srcdir)/Resources/GridLAB-D.pmdoc/01gldcore-contents.xml
EXTRA_DIST += $(top_srcdir)/Resources/GridLAB-D.pmdoc/01gldcore.xml
EXTRA_DIST += $(top_srcdir)/Resources/GridLAB-D.pmdoc/02climate-contents.xml
EXTRA_DIST += $(top_srcdir)/Resources/GridLAB-D.pmdoc/02climate.xml
EXTRA_DIST += $(top_srcdir)/Resources/GridLAB-D.pmdoc/03libxerces-contents.xml
EXTRA_DIST += $(top_srcdir)/Resources/GridLAB-D.pmdoc/03libxerces.xml
EXTRA_DIST += $(top_srcdir)/Resources/GridLAB-D.pmdoc/04devel-contents.xml
EXTRA_DIST += $(top_srcdir)/Resources/GridLAB-D.pmdoc/04devel.xml
EXTRA_DIST += $(top_srcdir)/Resources/GridLAB-D.pmdoc/index.xml
EXTRA_DIST += $(top_srcdir)/Resources/License.rtf
EXTRA_DIST += $(top_srcdir)/Resources/Readme.rtf
EXTRA_DIST += $(top_srcdir)/Resources/Welcome.rtf
EXTRA_DIST += $(top_srcdir)/VERSION
EXTRA_DIST += $(top_srcdir)/models/climate_csvreader_example.glm
EXTRA_DIST += $(top_srcdir)/models/collector_example.glm
EXTRA_DIST += $(top_srcdir)/models/diesel_deltamode_load_player_A.csv
EXTRA_DIST += $(top_srcdir)/models/diesel_deltamode_load_player_B.csv
EXTRA_DIST += $(top_srcdir)/models/diesel_deltamode_load_player_C.csv
EXTRA_DIST += $(top_srcdir)/models/Four_quadrant_inverter_example.glm
EXTRA_DIST += $(top_srcdir)/models/house_HVAC_example.glm
EXTRA_DIST += $(top_srcdir)/models/IEEE_13_Node_Test_Feeder.glm
EXTRA_DIST += $(top_srcdir)/models/IEEE_13_Node_With_Houses.glm
EXTRA_DIST += $(top_srcdir)/models/passive_controller_example.glm
EXTRA_DIST += $(top_srcdir)/models/random_fault_generator_example.glm
EXTRA_DIST += $(top_srcdir)/models/residential_zipload_example.glm
EXTRA_DIST += $(top_srcdir)/models/Standard_Weather.csv
EXTRA_DIST += $(top_srcdir)/models/subsecond_diesel_generator_example.glm
EXTRA_DIST += $(top_srcdir)/models/taxonomy_feeder_R1-12.47-1.glm
EXTRA_DIST += $(top_srcdir)/models/transactive_controller_example.glm
EXTRA_DIST += $(top_srcdir)/models/WA-Seattle.tmy2
EXTRA_DIST += $(top_srcdir)/models/WA-Yakima.tmy2
EXTRA_DIST += $(top_srcdir)/models/waterheater_example.glm
EXTRA_DIST += $(top_srcdir)/models/weather.csv
EXTRA_DIST += $(top_srcdir)/models/wind_turbine_example.glm
EXTRA_DIST += $(top_srcdir)/gldcore/gridlabd.htm
EXTRA_DIST += $(top_srcdir)/utilities/build_number
pkgdata_DATA += $(top_srcdir)/models/climate_csvreader_example.glm
pkgdata_DATA += $(top_srcdir)/models/collector_example.glm
pkgdata_DATA += $(top_srcdir)/models/diesel_deltamode_load_player_A.csv
pkgdata_DATA += $(top_srcdir)/models/diesel_deltamode_load_player_B.csv
pkgdata_DATA += $(top_srcdir)/models/diesel_deltamode_load_player_C.csv
pkgdata_DATA += $(top_srcdir)/models/Four_quadrant_inverter_example.glm
pkgdata_DATA += $(top_srcdir)/models/house_HVAC_example.glm
pkgdata_DATA += $(top_srcdir)/models/IEEE_13_Node_Test_Feeder.glm
pkgdata_DATA += $(top_srcdir)/models/IEEE_13_Node_With_Houses.glm
pkgdata_DATA += $(top_srcdir)/models/passive_controller_example.glm
pkgdata_DATA += $(top_srcdir)/models/random_fault_generator_example.glm
pkgdata_DATA += $(top_srcdir)/models/residential_zipload_example.glm
pkgdata_DATA += $(top_srcdir)/models/Standard_Weather.csv
pkgdata_DATA += $(top_srcdir)/models/subsecond_diesel_generator_example.glm
pkgdata_DATA += $(top_srcdir)/models/taxonomy_feeder_R1-12.47-1.glm
pkgdata_DATA += $(top_srcdir)/models/transactive_controller_example.glm
pkgdata_DATA += $(top_srcdir)/models/WA-Seattle.tmy2
pkgdata_DATA += $(top_srcdir)/models/WA-Yakima.tmy2
pkgdata_DATA += $(top_srcdir)/models/waterheater_example.glm
pkgdata_DATA += $(top_srcdir)/models/weather.csv
pkgdata_DATA += $(top_srcdir)/models/wind_turbine_example.glm
pkgdata_DATA += $(top_srcdir)/gldcore/gridlabd.htm
if MISSING_XERCES
all-local:
@echo
@echo " Missing dependency: libxerces-c"
@echo ""
@echo " libxerces-c was not found during configuration and is a required dependency."
@echo " Install the libxerces-c development libraries and re-run ./configure or run"
@echo " ./configure with the --with-xerces option. Try './configure --help' for"
@echo " more information."
@echo
@false
endif
help:
@echo "Cleaning targets:"
@echo " clean - Erase from the build tree the files built by 'make all'"
@echo " distclean - Same as 'make clean' plus erase anything ./configure created"
@echo " mostlyclean - Erase intermediate files (such as .o files)"
@echo ""
@echo "Building targets:"
@echo " all - Build $(PACKAGE) (same as 'make')"
@echo " install - Install $(PACKAGE) to $(prefix)"
@echo " install-strip - Same as install, but follow by stripping debug symbols"
@echo " uninstall - Erase files installed by 'make install'"
@echo ""
@echo "Testing targets:"
@echo " validate - Run the test/validation suite (requires Python)"
@echo ""
@echo "Packaging targets:"
@echo " dist - same as 'make dist-gzip'"
@echo " dist-bzip2 - Generate a bzip2 tar archive of the distribution"
@echo " dist-deb - Create Debian binary and source deb packages"
@echo " dist-deb-bin - Create Debian binary-only deb package"
@echo " dist-deb-src - Create Debian source-only deb package"
@echo " dist-gzip - Generate a gzip tar archive of the distribution"
@echo " dist-lzma - Generate an lzma tar archive of the distribution"
@echo " dist-osx - Create Mac OS X package installer (OS X w/ XCode only)"
@echo " dist-rpm - Create binary-only RPM package"
@echo " dist-shar - Generate a shar archive of the distribution"
@echo " dist-tarZ - Generate a compressed tar archive of the distribution"
@echo " dist-xz - Generate an xz tar archive of the distribution"
@echo " dist-zip - Generate a zip archive of the distribution"
@echo " rpm-prep - Create \$$HOME/.rpmmacros suitable for building RPMs in"
@echo " \$$HOME/rpmbuild as non-root user"
@echo ""
@echo "Documentation targets:"
@echo " doxygen-doc - Generate doxygen documentation (only if doxygen was found"
@echo " by ./configure)"
@echo ""
@echo "Developer targets (may require special tools):"
@echo " clean-wc - Recursively remove all files and directories not under"
@echo " revision control (will prompt to confirm first)"
@echo " ctags - Generate vi-style tags files"
@echo " tags - Generate emacs-style TAGS files"
@echo " maintainer-clean"
over: clean all
# Recursively remove all files and directories not under revision control
clean-wc:
@echo -e "\nThis removes all unversioned files and directories in the working copy."
@unset REPLY && read -t 60 -p "Clean working copy (type 'yes' to proceed)? " && test "`echo "$$REPLY" | tr '[:upper:]' '[:lower:]'`" = "yes"
. utilities/cleanwc
check-local validate:
gridlabd --validate
distdir = $(PACKAGE)_$(VERSION)
scratchdir = scratch
XERCES_TARNAME = xerces-c-3.1.1
XERCESCROOT = $(CURDIR)/$(scratchdir)/$(XERCES_TARNAME)
$(scratchdir)/.xerces.stamp: third_party/$(XERCES_TARNAME).tar.gz
-rm -f $@
test ! -e $(@D)/$(XERCES_TARNAME) || rm -rf $(@D)/$(XERCES_TARNAME)
test -d $(@D) || mkdir -p $(@D)
tar -xzf $< -C $(@D)
export XERCESCROOT=$(CURDIR)/$(@D)/$(XERCES_TARNAME) && \
cd $(@D)/$(XERCES_TARNAME) && \
autoreconf -isf && ./configure && make
touch $@
$(scratchdir)/pkg: $(scratchdir)/.xerces.stamp distdir
test ! -e $@ || rm -rf $@
test -d $@/gldcore || mkdir -p $@/gldcore
cd $(distdir) && ./configure --with-xerces=$(CURDIR)/$(scratchdir)/$(XERCES_TARNAME) && make install DESTDIR=$(CURDIR)/$@/gldcore
cd $@ && mkdir -p climate-data/usr/local/lib/gridlabd devel/usr/local/lib/gridlabd libxerces-c/usr/lib
# mv $@/gldcore/usr/lib/gridlabd/*.zip $@/climate-data/usr/lib/gridlabd/
mv $@/gldcore/usr/local/include $@/devel/usr/local/include
mv $@/gldcore/usr/local/lib/gridlabd/*.la $@/devel/usr/local/lib/gridlabd/
cp $(scratchdir)/$(XERCES_TARNAME)/src/.libs/libxerces-c.* $@/libxerces-c/usr/lib/
$(am__remove_distdir)
$(scratchdir)/$(PACKAGE_TARNAME).mpkg: $(scratchdir)/pkg
env PATH=$$PATH:/Developer/Applications/Utilities/PackageMaker.app/Contents/MacOS \
PackageMaker --doc Resources/GridLAB-D.pmdoc --version "$(PACKAGE_VERSION)" --title "$(PACKAGE_NAME)" --out $@
$(scratchdir)/$(PACKAGE_TARNAME).dmg: $(scratchdir)/$(PACKAGE_TARNAME).mpkg
test ! -e $@ || rm -f $@
hdiutil create -size $$((`du -sm $< | cut -f 1` + 3))m -fs HFS+ -volname "$(PACKAGE_STRING)" $@
hdiutil attach -mountpoint $(@D)/mnt $@
mv $< $(@D)/mnt/
hdiutil detach $(@D)/mnt
$(distdir).dmg: $(scratchdir)/$(PACKAGE_TARNAME).dmg
test ! -e $@ || rm -rf $@
hdiutil convert -format UDZO -o $@ $<
rm -f $<
-rmdir $(<D)
clean-dist-osx:
-test ! -d $(scratchdir)/mnt || hdiutil detach $(scratchdir)/mnt
# -rm -rf $(scratchdir)
# Build a .mpkg installer package for Mac OS X
dist-osx:
trap '$(MAKE) clean-dist-osx' EXIT && \
$(MAKE) $(distdir).dmg
# Build deb (binary and source) packages
dist-deb: distdir
echo -e "gridlabd ($(VERSION)-1) unstable; urgency=low\n\n * Version $(VERSION) release.\n * View recent changes at: https://sourceforge.net/apps/mediawiki/gridlab-d/index.php?title=Special:RecentChanges\n\n -- GridLAB-D Team <[email protected]> `date -R`\n" > $(distdir)/debian/changelog
ln -s $(distdir) $(distdir)-1
(cd $(distdir)-1 && dpkg-buildpackage -tc -us -uc $(DEBFLAGS))
rm -f $(distdir)-1
$(am__remove_distdir)
# Build Debian deb binary package
dist-deb-bin:
$(MAKE) dist-deb DEBFLAGS=-b
# Build Debian deb source package
dist-deb-src:
$(MAKE) dist-deb DEBFLAGS=-S
# Build RPM binary package
dist-rpm: dist-gzip
rpmbuild -tb $(distdir).tar.gz
RPMBUILDDIR = $(HOME)/rpmbuild
# Create $(HOME)/.rpmmacros file suitable for building RPMs in $(RPMBUILDDIR) as non-root user
rpm-prep:
@DIR="$(RPMBUILDDIR)" && if [ "$${DIR:0:1}" != "/" ]; then \
echo >&2 "ERROR: RPMBUILDDIR must be an absolute path"; exit 1; \
fi
@if [ -f "$$HOME/.rpmmacros" ]; then \
sed -i 's/^\(%_topdir\)/#\1/' $$HOME/.rpmmacros; \
echo >&2 "WARNING: $$HOME/.rpmmacros already exists; commenting out _topdir macros"; \
fi
@echo "%_topdir $(RPMBUILDDIR)" >> $$HOME/.rpmmacros
@echo "RPMs will be built in $(RPMBUILDDIR)"
@for DIR in $(RPMBUILDDIR)/{BUILD,BUILDROOT,RPMS,SOURCES,SPECS,SRPMS}; do \
test -d "$$DIR" || mkdir -p "$$DIR"; \
done
libtool: $(LIBTOOL_DEPS)
$(SHELL) ./config.status libtool