Skip to content

Commit fd09b65

Browse files
committed
Update Makefile to pull version from git
1 parent fca0772 commit fd09b65

10 files changed

Lines changed: 48 additions & 37 deletions

File tree

.gitignore

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

Makefile

Lines changed: 23 additions & 31 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 := 2016.02.00
2+
VERSION := $(shell git describe --tags --dirty)
33
PRODUCT := CFD Models Bundle
44
PROD_SNAME := CFDModels_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 := Sorbents Solvents
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

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

2621
# Get just the top part (not dirname) of each entry so cp -r does the right thing
@@ -47,35 +42,32 @@ all: $(PACKAGE)
4742
# Go into each category's subdir and break open the archives there
4843
# into the corresponding subdir in the PKG_DIR
4944
$(CATEGORIES):
45+
@echo "Packaging $@"
5046
@mkdir -p $(PKG_DIR)/$@
47+
@$(MAKE) -C $@ clean
48+
@$(MAKE) -C $@
5149

52-
@for tb in $(wildcard $@/$(TARBALLS)); do \
53-
tar -xzf $$tb -C $(PKG_DIR)/$@; \
54-
done
5550

56-
@for zf in $(wildcard $@/$(ZIPFILES)); do \
57-
unzip -qo $$zf -d $(PKG_DIR)/$@; \
58-
done
5951

60-
61-
$(PACKAGE): $(PAYLOAD) $(CATEGORIES)
52+
$(PACKAGE): $(CATEGORIES) $(PAYLOAD)
53+
@echo "Packaging $(PKG_DIR)"
6254
@mkdir -p $(PKG_DIR)
55+
@for cat in $(CATEGORIES); do \
56+
for tb in $$cat/**{,/*}/$(TARBALLS); do \
57+
if [ -f $$tb ]; then\
58+
tar -xf $$tb -C $(PKG_DIR)/$$cat/; \
59+
fi; \
60+
done; \
61+
for zf in $$cat/*/$(ZIPFILES); do \
62+
if [ -f $$zf ]; then\
63+
unzip -qo $$zf -d $(PKG_DIR)/$$cat; \
64+
fi; \
65+
done; \
66+
done
6367
@cp -r $(PAYLOAD_TOPS) $(PKG_DIR)
64-
@zip -qXr $(PACKAGE) $(PKG_PAYLOAD)
68+
@zip -qXr $(PACKAGE) $(PKG_DIR)
6569
@$(MD5BIN) $(PACKAGE)
66-
@rm -rf $(PKG_DIR) $(LEGAL_DOCS) $(LICENSE)
67-
68-
69-
$(LICENSE): CCSI_TE_LICENSE.txt
70-
@sed "s/\[SOFTWARE NAME \& VERSION\]/$(PRODUCT) v.$(VERSION)/" < CCSI_TE_LICENSE.txt > $(LICENSE)
71-
72-
$(LEGAL_DOCS):
73-
@if [ -d $(COMMON) ]; then \
74-
cp $(COMMON)/$@ .; \
75-
else \
76-
svn -q export ^/projects/common/trunk/$@; \
77-
fi
78-
70+
@rm -rf $(PKG_DIR)
7971

8072
clean:
81-
@rm -rf $(PACKAGE) $(PKG_DIR) $(LEGAL_DOCS) $(LICENSE)
73+
@rm -rf $(PACKAGE) $(PKG_DIR)

Solvents/Makefile

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
TOPTARGETS := all clean
2+
3+
SUBDIRS := $(wildcard */.)
4+
5+
$(TOPTARGETS): $(SUBDIRS)
6+
$(SUBDIRS):
7+
@$(MAKE) -C $@ $(MAKECMDGOALS)
8+
9+
.PHONY: $(TOPTARGETS) $(SUBDIRS)

Solvents/WWC

Solvents/vof_area_correlation

Sorbents/1mw_cfd

Sorbents/Makefile

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
TOPTARGETS := all clean
2+
3+
SUBDIRS := $(wildcard */.)
4+
5+
$(TOPTARGETS): $(SUBDIRS)
6+
$(SUBDIRS):
7+
@$(MAKE) -C $@ $(MAKECMDGOALS)
8+
9+
.PHONY: $(TOPTARGETS) $(SUBDIRS)

Sorbents/Pulverization

Sorbents/attrition

0 commit comments

Comments
 (0)