Commit 6b7aa78e authored by Pawel Szostek's avatar Pawel Szostek

Makefile: add release generation

Conflicts:
	Makefile
parent 20c784df
misc
src/build_hash.py
examples
# -*- coding: utf-8 -*-
#
# Copyright (c) 2011 Pawel Szostek (pawel.szostek@cern.ch)
#
# This source code is free software; you can redistribute it
......@@ -17,24 +15,35 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
#
SRC := configparser.py connection.py dep_solver.py fetch.py\
SRC_FILES := configparser.py connection.py dep_solver.py fetch.py\
flow.py flow_altera.py global_mod.py hdlmake_kernel.py\
__main__.py makefile_writer.py manifest_parser.py module.py msg.py path.py \
srcfile.py vlog_parser.py new_dep_solver.py
SRC_DIR := src
PREFIX := src
ARCH := hdlmake
SRC := $(foreach src, $(SRC_FILES), $(SRC_DIR)/$(src))
TAG = $(shell git describe --abbrev=0 --tags --always)#get the latest tag
RELEASE = hdlmake-$(TAG).tar.gz
EXEC := hdlmake
$(ARCH): $(foreach src, $(SRC), $(PREFIX)/$(src)) Makefile
executable: $(EXEC)
$(EXEC): $(SRC)
bash embed_build_id.sh
cd $(PREFIX) &&\
zip $(ARCH) $(SRC) &&\
echo '#!/usr/bin/python' > $(ARCH) &&\
cat $(ARCH).zip >> $(ARCH) &&\
rm $(ARCH).zip &&\
mv $(ARCH) ..
chmod +x $(ARCH)
cd $(SRC_DIR) &&\
zip $(EXEC) build_hash.py $(SRC_FILES) &&\
echo '#!/usr/bin/python' > $(EXEC) &&\
cat $(EXEC).zip >> $(EXEC) &&\
rm $(EXEC).zip &&\
chmod +x $(EXEC) &&\
mv $(EXEC) ..
release: $(RELEASE)
$(RELEASE): $(EXEC) $(SRC)
tar -zcvf $@ *
.PHONY: clean
clean:
rm -f $(PREFIX)/*~ $(PREFIX)/*pyc
\ No newline at end of file
rm -f $(SRC_DIR)/*~ $(PREFIX)/*pyc $(EXEC) hdlmake-*.tar.gz
......@@ -6,19 +6,7 @@ commit_string=$(echo $commit_line | awk '{print $2}')
date_line=$(git log | head -3 | tail -1)
date_string=$(echo $date_line | awk '{print $6 $3 $4}')
embed_string=$(echo "$date_string:${commit_string:0:6}")
embed_string='"'$(echo "$date_string:${commit_string:0:6}")'"'
if [ ! -f src/global_mod.py ]; then
echo "Can't find src/global_mod.py file to put the versionID inside"
exit 1
fi
global_mod_path="src/global_mod.py"
sed 's/^BUILD_ID =.*$/BUILD_ID = \"'$embed_string'"/' $global_mod_path > ${global_mod_path}_TMP
rm $global_mod_path
mv ${global_mod_path}_TMP $global_mod_path
if [ ! -f src/global_mod.py ]; then
echo "Shit! Something went wrong. Better check what happened to $global_mod_path"
exit 1
fi
\ No newline at end of file
build_hash_path="src/build_hash.py"
echo 'BUILD_ID = '"$embed_string" > $build_hash_path
No preview for this file type
......@@ -22,7 +22,4 @@
options = None
top_module = None
global_target = "''"
#######
#this var is modified by the build makefile - DON'T TOUCH IT!
BUILD_ID = "2013Jan23:405c28"
######
......@@ -21,6 +21,10 @@
import global_mod
try:
from build_hash import BUILD_ID
except:
BUILD_ID = "unrecognized"
import time
import os
import sys
......@@ -52,7 +56,7 @@ def vpprint(msg):
pp.pprint(msg)
def print_version():
rawprint("Hdlmake build "+global_mod.BUILD_ID)
rawprint("Hdlmake build " + BUILD_ID)
def print_action_help():
rawprint("`Action' variable was not specified")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment