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)
33PRODUCT := CFD Models Bundle
44PROD_SNAME := CFDModels_bundle
5- LICENSE := CCSI_TE_LICENSE_ $( PROD_SNAME ) .txt
5+ LICENSE := LICENSE.md
66PKG_DIR := CCSI_$(PROD_SNAME ) _$(VERSION )
77PACKAGE := $(PKG_DIR ) .zip
88
99CATEGORIES := 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-
1611TARBALLS := *.tgz
1712ZIPFILES := *.zip
1813
1914# The bundled packages, as found in each category subdir
2015SUB_PACKAGES := $(foreach c,$(CATEGORIES ) , $(wildcard $c/$(TARBALLS ) $c/$(ZIPFILES ) ) )
2116
2217PAYLOAD := 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
8072clean :
81- @rm -rf $(PACKAGE ) $(PKG_DIR ) $( LEGAL_DOCS ) $( LICENSE )
73+ @rm -rf $(PACKAGE ) $(PKG_DIR )
0 commit comments