Skip to content

Commit

Permalink
Refactored Makefile
Browse files Browse the repository at this point in the history
Closes #5
  • Loading branch information
vchendrix committed Jun 14, 2017
1 parent 23349f0 commit c690c89
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 23 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.zip
11 changes: 11 additions & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
Copyright <YEAR> <COPYRIGHT HOLDER>

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

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.

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.

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.
31 changes: 8 additions & 23 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,21 +1,16 @@
# A simple makefile for creating the 2MPZ distribution package
VERSION := `git describe --tags`
VERSION := $(shell git describe --tags --dirty)
PRODUCT := High Viscosity 2-MPZ Solvent Model
PROD_SNAME := 2MPZ
LICENSE := CCSI_TE_LICENSE_$(PROD_SNAME).txt
LICENSE := LICENSE.md
PKG_DIR := CCSI_$(PROD_SNAME)_$(VERSION)
PACKAGE := $(PKG_DIR).zip

# Where Jenkins should checkout ^/projects/common/trunk/
COMMON := .ccsi_common
LEGAL_DOCS := LEGAL \
CCSI_TE_LICENSE.txt

PAYLOAD := ThunderMoon.bkp \
PAYLOAD := README.md \
ThunderMoon.bkp \
2mpzloc.opt \
full.dll \
LEGAL \
$(LICENSE)
$(LICENSE) #\
# TODO: get Fortran files full.dll

# Get just the top part (not dirname) of each entry so cp -r does the right thing
PAYLOAD_TOPS := $(sort $(foreach v,$(PAYLOAD),$(shell echo $v | cut -d'/' -f1)))
Expand Down Expand Up @@ -43,18 +38,8 @@ $(PACKAGE): $(PAYLOAD)
@cp -r $(PAYLOAD_TOPS) $(PKG_DIR)
@zip -qrX $(PACKAGE) $(PKG_PAYLOAD)
@$(MD5BIN) $(PACKAGE)
@rm -rf $(PKG_DIR) $(LICENSE) $(LEGAL_DOCS)

$(LICENSE): CCSI_TE_LICENSE.txt
@sed "s/\[SOFTWARE NAME \& VERSION\]/$(PRODUCT) v.$(VERSION)/" < CCSI_TE_LICENSE.txt > $(LICENSE)

$(LEGAL_DOCS):
@if [ -d $(COMMON) ]; then \
cp $(COMMON)/$@ .; \
else \
svn -q export ^/projects/common/trunk/$@; \
fi
@rm -rf $(PKG_DIR)


clean:
@rm -rf $(PACKAGE) $(PKG_DIR) $(LICENSE) $(LEGAL_DOCS)
@rm -rf $(PACKAGE) $(PKG_DIR) *.zip

0 comments on commit c690c89

Please sign in to comment.