Skip to content

Commit 0cd12fc

Browse files
committed
Refactored Makefile, Submodule organization
Refactored Makefile to build submodules and include them in the final bundle. Closes #1
1 parent 952084b commit 0cd12fc

13 files changed

Lines changed: 40 additions & 34 deletions

File tree

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
*.zip
2+

LICENSE.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
Copyright <YEAR> <COPYRIGHT HOLDER>
2+
3+
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
4+
5+
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
6+
7+
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
8+
9+
3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
10+
11+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Makefile

Lines changed: 17 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,21 @@
11
# A simple makefile for creating the High Resolution CFD Models bundled product
2-
VERSION := `git describe --tags`
2+
VERSION := $(shell git describe --tags --dirty)
33
PRODUCT := Process Models Bundle
44
PROD_SNAME := ProcessModels_bundle
5-
LICENSE := CCSI_TE_LICENSE_$(PROD_SNAME).txt
5+
LICENSE := LICENSE.md
66
PKG_DIR := CCSI_$(PROD_SNAME)_$(VERSION)
77
PACKAGE := $(PKG_DIR).zip
88

99
CATEGORIES := SolidSorbents Solvents OtherModels
1010

11-
# Where Jenkins should checkout ^/projects/common/trunk/
12-
COMMON := .ccsi_common
13-
LEGAL_DOCS := LEGAL \
14-
CCSI_TE_LICENSE.txt
15-
1611
TARBALLS := *.tgz
1712
ZIPFILES := *.zip
1813

1914
# The bundled packages, as found in each category subdir
2015
SUB_PACKAGES := $(foreach c,$(CATEGORIES), $(wildcard $c/$(TARBALLS) $c/$(ZIPFILES)))
2116

22-
PAYLOAD := docs/*.pdf \
23-
LEGAL \
17+
PAYLOAD := README.md \
18+
docs/*.pdf \
2419
$(LICENSE)
2520

2621
# Get just the top part (not dirname) of each entry so cp -r does the right thing
@@ -49,30 +44,28 @@ all: $(PACKAGE)
4944
$(CATEGORIES):
5045
@mkdir -p $(PKG_DIR)/$@
5146

52-
@for tb in $(wildcard $@/$(TARBALLS)); do \
47+
@for dir in $(wildcard $@/*); \
48+
do \
49+
$(MAKE) -C $$dir clean; \
50+
$(MAKE) -C $$dir; \
51+
done
52+
53+
@for tb in $(wildcard $@/*/$(TARBALLS)); do \
5354
tar -xzf $$tb -C $(PKG_DIR)/$@; \
5455
done
5556

56-
@for zf in $(wildcard $@/$(ZIPFILES)); do \
57+
@for zf in $(wildcard $@/*/$(ZIPFILES)); do \
5758
unzip -qo $$zf -d $(PKG_DIR)/$@; \
5859
done
5960

60-
$(PACKAGE): $(PAYLOAD) $(CATEGORIES)
61+
62+
63+
$(PACKAGE): $(CATEGORIES) $(PAYLOAD)
6164
@mkdir -p $(PKG_DIR)
6265
@cp -r $(PAYLOAD_TOPS) $(PKG_DIR)
6366
@zip -qXr $(PACKAGE) $(PKG_PAYLOAD)
6467
@$(MD5BIN) $(PACKAGE)
65-
@rm -rf $(PKG_DIR) $(LEGAL_DOCS) $(LICENSE)
66-
67-
$(LICENSE): CCSI_TE_LICENSE.txt
68-
@sed "s/\[SOFTWARE NAME \& VERSION\]/$(PRODUCT) v.$(VERSION)/" < CCSI_TE_LICENSE.txt > $(LICENSE)
69-
70-
$(LEGAL_DOCS):
71-
@if [ -d $(COMMON) ]; then \
72-
cp $(COMMON)/$@ .; \
73-
else \
74-
svn -q export ^/projects/common/trunk/$@; \
75-
fi
68+
@rm -rf $(PKG_DIR)
7669

7770
clean:
78-
@rm -rf $(PACKAGE) $(PKG_DIR) $(LEGAL_DOCS) $(LICENSE)
71+
@rm -rf $(PACKAGE) $(PKG_DIR)

OtherModels/compressor

SolidSorbents/bfb_drom

SolidSorbents/bfb_reactor

SolidSorbents/intcap

SolidSorbents/mb_reactor

Solvents/2-mpz

0 commit comments

Comments
 (0)