-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
124 lines (103 loc) · 2.92 KB
/
Makefile
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
LSLINT?=`pwd`/lslint/lslint -b `pwd`/lslint/builtins.txt
SRC=$(wildcard src/*)
LIB=$(wildcard lib/*)
DBG=$(subst .lsl,.j,$(subst src,dbg,$(SRC))) $(subst .lsl,.i,$(subst src,dbg,$(SRC)))
OBJ=$(subst .lsl,.o,$(subst src,bin,$(SRC)))
HTML=$(subst .txt,.html,$(wildcard doc/*.txt))
FLAGS= -DDEBUG
#FLAGS=
all: prereqs $(DBG) $(OBJ) $(HTML) fini
fini:
@echo ===
@echo === compiled files are in bin
@echo ===
txt2html:
@if which txt2html; then echo txt2html found, good; else echo txt2html not found, please \'sudo apt-get install txt2html\'; exit -1; fi
lslint:
@if [ ! -d lslint ]; then \
echo ===; \
echo === LSLINT NOT FOUND, attempting to fetch and build it; \
echo ===; \
git clone https://github.com/pclewis/lslint.git; \
( cd lslint ; make ); \
echo; \
echo; \
fi
prereqs: txt2html lslint
docs: $(HTML)
cp doc/*.html ~/public_html
distro: clean
rm -rf open9
mkdir open9
mkdir open9/dbg
mkdir open9/bin
mkdir open9/web
mkdir open9/web/birth
mkdir open9/web/gates
mkdir open9/web/grave
cp -a Makefile open9
cp -a src open9
cp -a lib open9
cp -a doc open9
cp -a tools open9
cp web/*.pl web/*.cgi web/*.sh web/Makefile open9/web
tar -czvf open9.tar.gz open9
rm -rf open9
cp open9.tar.gz ~/public_html
cp open9.tar.gz ~/public_html/open9.`date +"%Y.%m.%d.%H.%M.%S"`.tar.gz
seeds:
wget -O - "http://ma8p.com/~opengate/xml.cgi?sort=BORN" | \
grep OBJECT_KEY | \
sed "s/[^-a-f0-9]//g" | \
head -150 > seeds
deps: $(SRC) $(LIB)
@rm -f deps
@touch deps
@makedepend -fdeps -Ilib src/*
@cat deps | sed "s/^src/bin/g" > deps2
@cat deps | sed "s/^src/dbg/g" | sed "s/\.o/.i/g" >> deps2
@mv deps2 deps
@rm deps.bak
importer: all
@rm -rf import
@mkdir import
@mkdir import/import_assets
@tools/import.pl > import/import.xml
@rm -rf /tmp/importer
@cp -a import /tmp/importer
debug: $(DBG)
graph:
(cd web; ./reap.pl; make)
clean:
rm -f seeds dbg/* bin/* deps deps.bak doc/*.html
dbg/%.i: src/%.lsl
@echo
@echo "COMPILING $<"
@echo -n "//" > $@
@/lib/cpp -Ilib -P $(FLAGS) $< | md5sum >> $@
@/lib/cpp -Ilib -P $(FLAGS) -DTIME=`date +0x%H%M%S` -DDATE=`date +0x%Y%m%d` $< >> $@
dbg/%.j: dbg/%.i
@/lib/cpp -Ilib -P $(FLAGS) -Dvoid= $< > $@
@-$(LSLINT) $@ 2>&1 | egrep -v "Unused event parameter .unused"
bin/%.o: dbg/%.i
@cat $< | tools/i2o.pl `basename $<` > $@
%.html: %.txt
@echo PROCESSING $<
@echo "<html>" > $@
@echo "<body text=white bgcolor=black link=cyan vlink=magenta alink=red>" >> $@
@echo "<font face=\"sans-serif\">" >> $@
@txt2html \
-pm \
--tables \
< $< | sed "s/[(]R[)]/\®/g" | sed "s/[(]TM[)]/\™/g" >> $@
@echo "</font></body></html>" >> $@
@chmod ugo+rx $@
dbg/phys_anglia-ui.i: lib/phys-ui.lsl
dbg/phys_destiny-ui.i: lib/phys-ui.lsl
dbg/phys_eleven-ui.i: lib/phys-ui.lsl
dbg/phys_generic-ui.i: lib/phys-ui.lsl
dbg/phys_oneprim-ui.i: lib/phys-ui.lsl
dbg/phys_simple-ui.i: lib/phys-ui.lsl
dbg/phys_super-ui.i: lib/phys-ui.lsl
dbg/phys_warp-ui.i: lib/phys-ui.lsl
-include deps