Skip to content

Commit e5c24f4

Browse files
committed
Added dist target to Makefile
1 parent e95d878 commit e5c24f4

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

LICENSE

-2
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,3 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
1818
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
1919
SOFTWARE.
2020

21-
22-
# vim: set et sw=4 sts=4 tw=78:

Makefile

+15
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
DBNAME:=SAMPLE
22
SCHEMANAME:=UTILS
33

4+
VERSION:=0.1
5+
ALL_EXT:=$(wildcard pcre/*.c) $(wildcard pcre/*.h)
46
ALL_SQL:=$(filter-out install.sql uninstall.sql test.sql,$(wildcard *.sql))
57
ALL_FOO:=$(ALL_SQL:%.sql=%.foo)
68

@@ -26,6 +28,19 @@ clean: $(SUBDIRS)
2628
rm -f *.foo
2729
rm -f install.sql
2830
rm -f uninstall.sql
31+
rm -fr build/ dist/
32+
33+
dist: $(ALL_SQL) $(ALL_EXT) \
34+
INSTALL LICENSE \
35+
Makefile pcre/Makefile \
36+
uninstall.awk test.awk test.dat
37+
mkdir -p build/db2utils/
38+
mkdir -p dist/
39+
for f in $^; do \
40+
mkdir -p build/db2utils/$$(dirname $$f)/ ; \
41+
cp $$f build/db2utils/$$(dirname $$f)/ ; \
42+
done
43+
tar -cvzf dist/db2utils-$(VERSION).tar.gz -C build/ db2utils/
2944

3045
%.foo: %.sql
3146
cat $< >> foo

0 commit comments

Comments
 (0)