Commit fbfab7c7 authored by Pawel Szostek's avatar Pawel Szostek

Makefile: add release generation

Conflicts:
	Makefile
parent 349d03a1
misc
src/build_hash.py
examples
hdlmake.aux
hdlmake.pdf
......
# -*- coding: utf-8 -*-
#
# Copyright (c) 2011 Pawel Szostek (pawel.szostek@cern.ch)
#
# This source code is free software; you can redistribute it
......@@ -23,16 +21,16 @@ __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
SRC = $(foreach src, $(SRC_FILES), $(SRC_DIR)/$(src))
TAG := $(shell git describe --abbrev=0 --tags)
RELEASE := hdlmake-$(TAG).tar.gz
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
executable: $(EXEC)
$(EXEC): $(SRC)
bash embed_build_id.sh
cd $(SRC_DIR) &&\
zip $(EXEC) $(SRC_FILES) &&\
zip $(EXEC) build_hash.py $(SRC_FILES) &&\
echo '#!/usr/bin/python' > $(EXEC) &&\
cat $(EXEC).zip >> $(EXEC) &&\
rm $(EXEC).zip &&\
......@@ -46,5 +44,5 @@ $(RELEASE): $(EXEC) $(SRC)
.PHONY: clean
clean:
rm -f $(PREFIX)/*~ $(PREFIX)/*pyc $(EXEC) hdlmake-*.tar.gz
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,10 @@
options = None
top_module = None
global_target = "''"
<<<<<<< HEAD
#######
#this var is modified by the build makefile - DON'T TOUCH IT!
BUILD_ID = "2013Feb22:341efe"
=======
>>>>>>> Makefile: add release generation
######
......@@ -21,6 +21,10 @@
import global_mod
try:
from build_hash import BUILD_ID
except:
BUILD_ID = "unrecognized"
import time
import pprint as prettyprinter
......@@ -58,7 +62,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