File: Makefile.st

package info (click to toggle)
mol 0.9.61-6
  • links: PTS
  • area: contrib
  • in suites: woody
  • size: 6,140 kB
  • ctags: 8,491
  • sloc: ansic: 50,560; asm: 2,826; sh: 458; makefile: 373; perl: 165; lex: 135; yacc: 131
file content (113 lines) | stat: -rw-r--r-- 3,809 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
# # -*-makefile -*-
#
#   Creation Date: <1999/03/28 04:20:31 samuel>
#   Time-stamp: <2001/08/25 23:14:46 samuel>
#   
#	<Makefile.dist>
#	
#	Some extra rules to simplify building from source-only
#	trees (e.g. the MOL bitkeeper tree or a rsynced copy)
#   
#   Copyright (C) 1999, 2000, 2001 Samuel Rydh (samuel@ibrium.se)
#   
#   This program is free software; you can redistribute it and/or
#   modify it under the terms of the GNU General Public License
#   as published by the Free Software Foundation
#

SOURCETREE_BUILD = yes

ifdef INCLUDE_ST_RULES
NEW_VERSION	= $(shell scripts/version.pl sinclude/version.h).$(shell expr $(PATCH_LEVEL) + 1)

FULLTAR 	= mol-$(VERSION)

####################################################################
# Host/rsync modules of the mac-side binary distribution
####################################################################

RSYNC_HOST	= zorn.theophys.kth.se
RSYNC_LIBMOD	= libmol
RSYNC_LIBMOD_RW = libmol-rw

LIBIMPORT_DIR	= libimport/
EXTRA_BIN_FILES	 = pci_roms/*.nw pci_roms/*.pcirom nvram/nvram.dist startboing
EXTRA_BIN_FILES_ = $(shell if [ -d $(LIBIMPORT_DIR) ] ; then \
			cd $(LIBIMPORT_DIR); find . $(foreach x,  \
			$(EXTRA_BIN_FILES), -path "./$(x)" -o) -false ; fi )

copybinfiles: dummy
	@if [ -d $(LIBIMPORT_DIR) ] ; then \
		echo "--- Copying binary files from $(LIBIMPORT_DIR) to $(MOL_LIB_DIR) ---" ; \
		$(foreach x, $(EXTRA_BIN_FILES_), cp $(LIBIMPORT_DIR)/$(x) $(MOL_LIB_DIR)/$(x) ; ) \
		cp $(LIBIMPORT_DIR)/images/*.im $(MOL_LIB_DIR)/images/ ; \
	fi

deletemacfiles: dummy
	cd $(MOL_LIB_DIR) ; rm -f $(EXTRA_BIN_FILES)
	cd $(MOL_LIB_DIR)/images/ ; rm -f *.im


####################################################################
# Targets for downloading the binary files
####################################################################

libimport: import2 copybinfiles

import2: dummy
	rsync -avz --delete $(RSYNC_HOST)::$(RSYNC_LIBMOD)/ $(LIBIMPORT_DIR)
	@echo "======================================================" > $(LIBIMPORT_DIR)/README
	@echo "  IMPORTANT: DON'T EDIT ANY FILES IN THIS DIRECTORY" >> $(LIBIMPORT_DIR)/README
	@echo "======================================================" >> $(LIBIMPORT_DIR)/README
	@echo " Modify the files in ../mollib/ instead" >> $(LIBIMPORT_DIR)/README
	@echo >> $(LIBIMPORT_DIR)/README

libimport_clean: dummy
	$(RM) -r $(LIBIMPORT_DIR)

libexport: clean
	@if [ ! -f $(MOL_LIB_DIR)/pci_roms/osi_video.nw ] ; then \
		echo "====== This tree does not contain any binary files! ====" ; \
		exit 1; \
	fi
	rsync -avz --exclude-from=.exclude --exclude-from=.libexclude --delete \
		--delete-excluded mollib/ $(RSYNC_HOST)::$(RSYNC_LIBMOD_RW)/


####################################################################
# Distribution targets
####################################################################

dist:	archive rpm dist_ok_warning

dist_ok_warning: dummy
	@echo
	@echo "++++ Don't forget 'make dist_ok' ++++"
	@echo

dist_ok: dummy
	@bk citool
	@read -p "Proceed [y/N]? " A ; [ "$$A" == 'y' -o "$$A" == "Y" ] \
		|| (echo "*** Aborting ***" && false ) ;
	@bk tag "mol-$(VERSION)"
	@bk edit patchlevel.h ; true
	@echo "New patch level: " $(shell expr $(PATCH_LEVEL) + 1)
	@echo "#define PATCH_LEVEL   " $(shell expr $(PATCH_LEVEL) + 1) > patchlevel.h
	@bk ci -u -y"Starting on mol-$(NEW_VERSION)" patchlevel.h
	@bk commit -q

archive: dummy
	@echo '*** ONLY THE CHECKED-IN CHANGESETS ARE INCLUDED (!) ***'
	@echo
	@echo '--- ARCHIVE $(VERSION) ---'
	@echo
	sleep 1
	rm -rf /tmp/molbuild
	mkdir /tmp/molbuild
	bk export ./ /tmp/molbuild/$(FULLTAR)
	cp -a libimport /tmp/molbuild/$(FULLTAR)/libimport ; true
	cd /tmp/molbuild/$(FULLTAR) ; make libimport copybinfiles libimport_clean
	cd /tmp/molbuild ; $(TAR) -hzcf /tmp/$(FULLTAR).tgz $(FULLTAR)
	rm -rf /tmp/molbuild

endif