Merge branch 'dev-2.1' into doxy-trial

# Conflicts fixed:
#	include/epanet2.h
#	src/epanet.c
This commit is contained in:
sam hatchett
2015-11-28 13:22:45 -05:00
11 changed files with 274 additions and 90 deletions

View File

@@ -41,10 +41,13 @@ runcmdname = runepanet2.sh
epanetincludedir = ../../include
# Search path for sources
epanetsrcdir = ../../src
VPATH = $(epanetsrcdir):$(epanetincludedir)
epanetrundir = ../../run
VPATH = $(epanetsrcdir):$(epanetincludedir):$(epanetrundir)
# Install directories
prefix = ~
#prefix = /usr/local # GNU standard -- requires superuser rights
prefix =~
#
exec_prefix = $(prefix)
libdir = $(exec_prefix)/lib
bindir = $(exec_prefix)/bin
@@ -66,11 +69,11 @@ INSTALL_DATA = $(INSTALL) -m 644
# Files for the shared object library
epanet_objs=hash.o hydraul.o inpfile.o input1.o input2.o \
input3.o mempool.o output.o quality.o report.o \
rules.o smatrix.o
rules.o smatrix.o epanet.o
# Epanet header files
epanet_heads=enumstxt.h funcs.h hash.h mempool.h text.h toolkit.h types.h vars.h
epanet_heads=enumstxt.h funcs.h hash.h mempool.h text.h types.h vars.h
# Epanet main program
epanet_main=epanet
epanet_main=main
# Epanet main program header files
epanet_main_heads=epanet2.h
@@ -78,11 +81,9 @@ epanet_main_heads=epanet2.h
all: $(libname) $(exename)
$(libname): $(epanet_objs)
$(CC) $(CFLAGS) $(CPPFLAGS) -D SOL -c $(epanetsrcdir)/$(epanet_main).c
$(CC) $(CFLAGS) $(LDFLAGS) -shared -o $@ $(epanet_main).o $^
$(CC) $(CFLAGS) $(LDFLAGS) -shared -o $@ $^
$(exename): $(libname) $(epanet_main_heads)
$(CC) $(CFLAGS) $(CPPFLAGS) -D CLE -c $(epanetsrcdir)/$(epanet_main).c
$(exename): $(epanet_main).o $(epanet_main_heads)
$(CC) $(CFLAGS) -o $@ $(epanet_main).o -l$(epanetrootname) $(LDFLAGS)
$(epanet_objs): $(epanet_heads)
@@ -95,7 +96,7 @@ install:
$(INSTALL_PROGRAM) -D $(exename) $(bindir)/$(exename)
$(INSTALL_PROGRAM) -D $(libname) $(libdir)/$(libname)
$(INSTALL_DATA) -D $(epanetincludedir)/epanet2.h $(includedir)/epanet2.h
$(INSTALL_PROGRAM) -D $(runcmdname) $(bindir)/$(runcmdname)
$(INSTALL_PROGRAM) -D $(runcmdname) ~/$(runcmdname)
.PHONY: uninstall
uninstall:

View File

@@ -0,0 +1,3 @@
#!/bin/sh
export LD_LIBRARY_PATH=libdir:$LD_LIBRARY_PATH
exec exename $*

78
build/MinGW/Makefile Normal file
View File

@@ -0,0 +1,78 @@
# MINGW32 Makefile for EPANET
# This will build EPANET as DLL
# (epanet2.dll) under MINGW32 GCC, and a standalone
# executable (epanet2d.exe).
# The following targets are defined:
# make
# -Builds epanet2.dll, epanet2d.exe
# make install
# -Copy epanet2.dll, epanet2d.exe, epanet2.def to $(prefix)
# make clean
# -Removes object and library files, returning the build directory
# to its pristine state.
# You may wish to change the install path 'prefix',
# or the compiler flags, but these defaults should be fine.
# Target filenames
epanetrootname := epanet2
libname := $(epanetrootname).dll
exename := $(epanetrootname)d.exe
# Location of EPANET toolkit includes
epanetincludedir = ../../include
# Search path for sources
epanetsrcdir = ../../src
# Search path for sources
epanetmainsrcdir = ../../run
VPATH = $(epanetsrcdir):$(epanetincludedir):$(epanetmainsrcdir)
# Install directories
prefix = C:\discoD\EPA\EPAnet_util
execdir = $(prefix)
libdir = $(prefix)
# Compiler and flags
CC = gcc
CFLAGS = -g -O3 -std=c99 -Wno-implicit-function-declaration -D DLL
CPPFLAGS = -I $(epanetincludedir) -I $(epanetsrcdir)
LDFLAGS = -L . -Wl,--kill-at,--enable-stdcall-fixup,-rpath,$(libdir) -lm
# Files for the shared object library
epanet_objs=hash.o hydraul.o inpfile.o input1.o input2.o \
input3.o mempool.o output.o quality.o report.o \
rules.o smatrix.o epanet.o
# Epanet header files
epanet_heads=enumstxt.h funcs.h hash.h mempool.h text.h types.h vars.h epanet2.h
# Epanet main program
epanet_main=main
# Epanet main program header files
epanet_main_heads=epanet2.h
.PHONY: all
all: $(libname) $(exename)
$(libname): $(epanet_objs)
$(CC) $(CFLAGS) $(LDFLAGS) -shared -o $@ $^ -Wl,--output-def,$(epanetrootname).def
$(exename): $(epanet_main_heads) $(libname) $(epanet_main).o
$(CC) $(CFLAGS) -o $@ $(epanet_main).o -l$(epanetrootname) $(LDFLAGS)
$(epanet_objs): $(epanet_heads)
.PHONY: clean
clean:
del $(epanet_main).o $(epanet_objs) $(exename) $(libname) $(epanetrootname).def
.PHONY: install
install:
copy $(exename) $(execdir)
copy $(libname) $(libdir)
copy $(epanetrootname).def $(libdir)

View File

@@ -66,7 +66,7 @@ EXPORTS
ENgetqualinfo = _ENgetqualinfo@16
ENsetbasedemand = _ENsetbasedemand@12
ENgetaveragepatternvalue = _ENgetaveragepatternvalue@8
ENgetheadcurve = _ENgetheadcurve@8
ENgetheadcurveindex = _ENgetheadcurveindex@8
ENgetpumptype = _ENgetpumptype@8
ENgetcurveindex = _ENgetcurveindex@8
ENgetcurveid = _ENgetcurveid@8

View File

@@ -59,6 +59,8 @@
2255754917551234009946B1 /* report.c in Sources */ = {isa = PBXBuildFile; fileRef = 22322F7E1068369500641384 /* report.c */; };
2255754A17551234009946B1 /* rules.c in Sources */ = {isa = PBXBuildFile; fileRef = 22322F7F1068369500641384 /* rules.c */; };
2255754B17551234009946B1 /* smatrix.c in Sources */ = {isa = PBXBuildFile; fileRef = 22322F801068369500641384 /* smatrix.c */; };
225762C51C068A3900484EC7 /* Net1.inp in CopyFiles */ = {isa = PBXBuildFile; fileRef = 225762C31C068A2A00484EC7 /* Net1.inp */; };
225762C61C068A3B00484EC7 /* Net2.inp in CopyFiles */ = {isa = PBXBuildFile; fileRef = 225762C41C068A2A00484EC7 /* Net2.inp */; };
226537E0179EDEEB00258C60 /* epanet2.h in Headers */ = {isa = PBXBuildFile; fileRef = 22322FA9106836B000641384 /* epanet2.h */; };
22CD9A5E1B27898E00B65E83 /* main.c in Sources */ = {isa = PBXBuildFile; fileRef = 22CD9A5D1B27898E00B65E83 /* main.c */; };
22CD9A611B278BB900B65E83 /* libepanet-static.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 2255753B17551217009946B1 /* libepanet-static.a */; };
@@ -89,6 +91,8 @@
dstSubfolderSpec = 6;
files = (
223109E61BA865930030AAE8 /* Net3.inp in CopyFiles */,
225762C51C068A3900484EC7 /* Net1.inp in CopyFiles */,
225762C61C068A3B00484EC7 /* Net2.inp in CopyFiles */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -106,8 +110,6 @@
/* Begin PBXFileReference section */
223109E31BA8658A0030AAE8 /* Net3.inp */ = {isa = PBXFileReference; lastKnownFileType = text; name = Net3.inp; path = "../../example-networks/Net3.inp"; sourceTree = "<group>"; };
223109E41BA8658A0030AAE8 /* sampletown.inp */ = {isa = PBXFileReference; lastKnownFileType = text; name = sampletown.inp; path = "../../example-networks/sampletown.inp"; sourceTree = "<group>"; };
223109E51BA8658A0030AAE8 /* simplenet.inp */ = {isa = PBXFileReference; lastKnownFileType = text; name = simplenet.inp; path = "../../example-networks/simplenet.inp"; sourceTree = "<group>"; };
223109F31BA869DA0030AAE8 /* runepanet copy */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = "runepanet copy"; sourceTree = BUILT_PRODUCTS_DIR; };
22310A091BA869F30030AAE8 /* libepanet-static copy.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libepanet-static copy.a"; sourceTree = BUILT_PRODUCTS_DIR; };
22322F66106833BB00641384 /* runepanet */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = runepanet; sourceTree = BUILT_PRODUCTS_DIR; };
@@ -133,6 +135,8 @@
22322F841068369500641384 /* vars.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = vars.h; path = ../../src/vars.h; sourceTree = SOURCE_ROOT; };
22322FA9106836B000641384 /* epanet2.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 2; name = epanet2.h; path = ../../include/epanet2.h; sourceTree = SOURCE_ROOT; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; };
2255753B17551217009946B1 /* libepanet-static.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libepanet-static.a"; sourceTree = BUILT_PRODUCTS_DIR; };
225762C31C068A2A00484EC7 /* Net1.inp */ = {isa = PBXFileReference; lastKnownFileType = text; name = Net1.inp; path = "../../example-networks/Net1.inp"; sourceTree = "<group>"; };
225762C41C068A2A00484EC7 /* Net2.inp */ = {isa = PBXFileReference; lastKnownFileType = text; name = Net2.inp; path = "../../example-networks/Net2.inp"; sourceTree = "<group>"; };
22CD9A5D1B27898E00B65E83 /* main.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = main.c; path = ../../run/main.c; sourceTree = "<group>"; };
D2AAC0630554660B00DB518D /* libepanet.dylib */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.dylib"; includeInIndex = 0; path = libepanet.dylib; sourceTree = BUILT_PRODUCTS_DIR; };
/* End PBXFileReference section */
@@ -233,8 +237,8 @@
isa = PBXGroup;
children = (
223109E31BA8658A0030AAE8 /* Net3.inp */,
223109E41BA8658A0030AAE8 /* sampletown.inp */,
223109E51BA8658A0030AAE8 /* simplenet.inp */,
225762C31C068A2A00484EC7 /* Net1.inp */,
225762C41C068A2A00484EC7 /* Net2.inp */,
);
name = "sample networks";
sourceTree = "<group>";