File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2727
2828DEBUG := 0
2929
30- .PHONY : default clean modules load unload install patch check_hdaps mk-hdaps.diff
30+ .PHONY : default clean modules load unload install patch check_hdaps mk-hdaps.diff \
31+ check-ver set-version create-tgz create-rpm
3132export TP_MODULES
3233
3334# ####################################################################
@@ -136,16 +137,29 @@ patch: $(KSRC)
136137# ####################################################################
137138# Tools for preparing a release. Ignore these.
138139
139- set-version :
140+ TGZ =../tp_smapi-$(VER ) .tgz
141+
142+ check-ver :
143+ @if [ -z " $( VER) " ]; then \
144+ echo " VER is unset" ; \
145+ echo " run: $( MAKE) $( MAKECMDGOALS) VER=<release version>" ; \
146+ exit 1 ; \
147+ fi
148+
149+ set-version : check-ver
140150 perl -i -pe ' s/^(tp_smapi version ).*/$${1}$(VER)/' README
141151 perl -i -pe ' s/^(#define TP_VERSION ").*/$${1}$(VER)"/' thinkpad_ec.c tp_smapi.c
142152
143- TGZ =../tp_smapi-$(VER ) .tgz
144- create-tgz :
153+ create-tgz : check-ver
145154 git archive --format=tar --prefix=tp_smapi-$(VER ) / HEAD | gzip -c > $(TGZ )
146155 tar tzvf $(TGZ )
147156 echo " Ready: $( TGZ) "
148157
158+ create-rpm : create-tgz
159+ mkdir -p rpmbuild
160+ rpmbuild -tb --define " _topdir $$ PWD/rpmbuild" $(TGZ )
161+
162+
149163else
150164# ####################################################################
151165# This part runs as a submake in kernel Makefile context:
You can’t perform that action at this time.
0 commit comments