-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathall.gmk
executable file
·212 lines (176 loc) · 5.62 KB
/
all.gmk
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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
# Copyright (c) 1998,1999,2001,2002,2003 Kevin Cameron
# Distributed under the GNU Lesser General Public License
# RCS ID: $Id: all.gmk,v 1.76 2012/10/16 22:43:06 cvs Exp $
default: all
LVL1_DIRS:=$(subst /all.gmk,,$(wildcard */all.gmk | grep -v import))
LVL2_DIRS:=$(subst /all.gmk,,$(wildcard */*/all.gmk | grep -v import))
LVL3_DIRS:=$(subst /all.gmk,,$(wildcard */*/*/all.gmk | grep -v import))
ALL_DIRS :=$(LVL1_DIRS) $(LVL2_DIRS) $(LVL3_DIRS)
ifndef CONFIG_DIR
CONFIG_DIR=$(HOME)/$(PROJECT)-$(VERSION)/config
endif
OVERRIDE_SETUP=TRUE
OVERRIDE_CLEAN=TRUE
EXP_EXTRA =v2k v2k.sh v2k.csh v2v
v2k_dir:
cd .. ;\
if [ ! -d $(PROJECT)-$(V2K_DEV_VRSN) ] ; then\
ln -s $(SOURCE_DIR) $(PROJECT)-$(V2K_DEV_VRSN) ;\
fi;
include $(CONFIG_DIR)/common.gmk
dirs:
@echo $(SRC_DIRS)
ifndef V2K_DIR
V2K_DIR=$(PROJECT_DIR)
endif
EXP_HDRS_V=simulation.h veri_enum.h av_types.h timing.inc sim_arith.h\
sim_types.h v2k_misc.h v2k_ll.h
exp_headers_v:
mkdir -p import/v2k/include/sys ;\
cd import/v2k/include/sys ; for h in $(EXP_HDRS_V) ; do\
rm -f $$h;\
ln -s ../../../src/include/$$h . ; done
EXP_HDRS_PC=parc.h
exp_headers_pc:
mkdir -p import/v2k/include/parc ;\
cd import/v2k/include/parc ; for h in $(EXP_HDRS_PC) ; do\
rm -f $$h;\
ln -s ../../../src/include/$$h . ; done
exp_headers: exp_headers_v exp_headers_pc
fix_links:
ROOT=`pwd`; cd import/v2k/$(OBJ_DIR); pwd;\
if [ ! -d ../include ] ; then\
ln -s $$ROOT/export/include .. ; fi ;\
if [ ! -f ../.v2krc ] ; then ln -s $$ROOT/export/.v2krc .. ; fi
setup: bin_links imports exp_headers
if [ -h ../$(PROJECT)-top -o -d ../$(PROJECT)-top ] ; then\
echo "'$(PROJECT)-top link not set!'";\
else\
rm ../$(PROJECT)-top;\
ln -s $(PROJECT)-$(V2K_DEV_VRSN) ../$(PROJECT)-top;\
fi
if [ ! -d $(V2K_DIR) ] ; then\
rm $(V2K_DIR);\
ln -s `pwd` $(V2K_DIR);\
fi;\
mkdir $(OBJ_DIR);\
PATH=$$PATH:$(CWD)/bin;\
for d in $(LVL2_DIRS) $(LVL3_DIRS) export/lib export/bin ; do \
if [ ! -d $$d ] ; then mkdir $$d ; fi;\
(cd $$d ; rm -fr $(OBJ_DIR); $(MK_SCRIPT) setup);\
done
CLEAN_ALL:
cat config/unames | (read UNAMEA ;\
while [ ! -z "$$UNAMEA" ] ; do\
echo "$$UNAMEA";\
export UNAMEA; $(MK_SCRIPT) CLEAN;\
read UNAMEA ;\
done ; exit 0)
cln_htm: clean_docs
for d in $(LVL2_DIRS) $(LVL3_DIRS) ; do\
$(MK_SCRIPT) $(MK_FLAGS) -cd $$d -fast clean_docs;\
done
CLEAN: cln_htm
rm -f $(CONFIG_DIR)/version.gmk export/lib/$(OBJ_DIR)/*.*\
export/bin/$(OBJ_DIR)/*;\
cd src ; $(MK_SCRIPT) -env CLEAN
source:
cd src ; $(MK_SCRIPT)
TAR_VERSION=$(PROJECT)-$(V2K_DEV_VRSN)
cvs_tgz:
cd `cat CVS/Repository` ;\
$(GTAR) -czf $(CWD)/export/$(TAR_VERSION)C.tar.gz *
V2K_SHELL=csh
bin_links:
if [ ! -x bin/v2k ] ; then\
rm -f bin/v2k ; ln -s v2k.$(V2K_SHELL) bin/v2k; \
fi
src_tgz: v2k_dir README
cd .. ;\
$(GTAR) $(foreach u,$(DONT_TAR),--exclude=$(u)) -c$(USR_TRFLG)f\
$(TAR_VERSION)/export/$(TAR_VERSION).tar\
$(TAR_VERSION)/README\
$(TAR_VERSION)/README2.c\
$(TAR_VERSION)/LICENSE\
$(TAR_VERSION)/LGPL\
$(TAR_VERSION)/doxy.tmpl\
$(TAR_VERSION)/*.gmk\
$(TAR_VERSION)/src\
$(TAR_VERSION)/config\
$(TAR_VERSION)/configure\
$(TAR_VERSION)/bin\
$(TAR_VERSION)/docs\
$(TAR_VERSION)/export/lib/all.gmk\
$(TAR_VERSION)/export/lib/compressors\
$(TAR_VERSION)/export/bin/all.gmk\
$(TAR_VERSION)/export/include\
$(TAR_VERSION)/export/.v2krc\
$(TAR_VERSION)/examples;\
echo "compressing...";
rm -f export/$(TAR_VERSION).tar.gz ;\
gzip -9 export/$(TAR_VERSION).tar
chmod 444 export/$(TAR_VERSION).tar.gz
bin_tgz: exports README2
cd .. ; \
if [ ! -e $(TAR_VERSION) ] ; then\
ln -s $(PROJECT)-top $(TAR_VERSION) ; fi; \
GZ="";\
for gz in CVS .cvsignore $(OBJ_DIR) include \*_obj \*_obj-64\
$(TAR_VERSION)/export/*.tar\
$(TAR_VERSION)/export/*.tar\
$(TAR_VERSION)/export/*.tar*.gz ;\
do\
GZ="$$GZ --exclude=$$gz" ;\
done ;\
$(GTAR) $$GZ -cvf\
$(TAR_VERSION)/export/$(TAR_VERSION)-$(SYS_OS)-$(SYS_CPU).tar\
$(TAR_VERSION)/configure\
$(TAR_VERSION)/README2\
$(TAR_VERSION)/examples\
$(TAR_VERSION)/export;\
echo "adding object...";\
$(GTAR) -rvf\
$(TAR_VERSION)/export/$(TAR_VERSION)-$(SYS_OS)-$(SYS_CPU).tar\
$(TAR_VERSION)/export/*/$(OBJ_DIR)/*;\
echo "adding headers...";\
$(GTAR) --exclude=\*CVS -hrvf\
$(TAR_VERSION)/export/$(TAR_VERSION)-$(SYS_OS)-$(SYS_CPU).tar\
$(TAR_VERSION)/export/include/*;\
echo "compressing...";
rm -f export/$(TAR_VERSION)-$(SYS_OS)-$(SYS_CPU).tar.gz ;\
gzip -9 export/$(TAR_VERSION)-$(SYS_OS)-$(SYS_CPU).tar
chmod 444 export/$(TAR_VERSION)-$(SYS_OS)-$(SYS_CPU).tar.gz
TARF: src_tgz
tarf: v2k_dir CLEAN_ALL exports src_tgz cvs_tgz
all_html:
rm -f docs/dir-list.txt
for d in $(LVL2_DIRS) $(LVL3_DIRS) ; do\
$(MK_SCRIPT) $(MK_FLAGS) -cd $$d -i html DOCUMENTING=TRUE;\
echo $$d >>docs/dir-list.txt ;\
done
docs: doxy all_html
$(MK_SCRIPT) $(MK_FLAGS) -cd docs
CVS2HTML_ARG=-a
cvs-html/all:
if [ ! -d cvs-html ] ; then\
echo "This directory should probably be linked from somewhere that is not backed up";\
exit 1;\
fi
cvs2html $(CVS2HTML_ARG) -o cvs-html/v2k
status: $(foreach d,$(BIN_DIR) export $(CONFIG_DIR) $(LVL2_DIRS) $(LVL3_DIRS),$(d)/cvs.sts)
fix_ids: $(foreach d,$(BIN_DIR) export $(CONFIG_DIR) $(LVL2_DIRS) $(LVL3_DIRS),$(d)/fix.ids)
apps:
mk -cd src/include
mk -cd src/common
mk -cd src/languages
mk -cd src/v2ksim
mk -cd src/command
mk -cd src/parc
help: README
@echo Targets:
@echo " setup - Create directories"
@echo " apps - Build applications"
@echo " status - Shortform CVS status"
@echo ""
@echo "See README for more"
all: help