AVsitter/AVsitter2/Makefile
Sei Lisa 65c067cc30 Prepare the core scripts for OpenSim.
- Add Makefile and release creation instructions.
- Add a simple Python program to automate the OpenSim conversion based on markings in the code.
- Add .gitignore entries for the generated files.
- Add parentheses around assignments as required by OpenSim. This is done only to the core scripts.
- OpenSim isn't compatible with SL when there are conditions of type key. Those are all converted. Conditions of other types, except integer, are expanded for clarity and optimization, as they generate the same or better code that way, and currently the optimizer can do a better job when they are expanded.
- Floats in scientific notation need a dot.
- llParseStringXXXX doesn't work the same in OpenSim as in SL, when the separator is an Unicode codepoint that doesn't represent a character. For that reason, the internal separator, which is U+FFFD ("Replacement Character") is changed automatically by the Python program to U+001F (Unit Separator control character). For further safety, function strReplace is altered to use osReplaceString instead of llParseStringKeepNulls/llDumpList2String.

Furthermore, the ~ operator has the wrong precedence in OpenSim, but that was handled by a previous commit. Note that appearances of the ~ operator that were not preceded by a ! have only been replaced in the core scripts.
2017-09-02 09:45:52 +02:00

87 lines
2.2 KiB
Makefile

# Configuration area
# Full path to Python. For Windows this is typically
# C:\Python27\python.exe; if it is in your path you don't need to change it.
PYTHON=python
# Full path to main.py in the optimizer. Depends on where it was unpacked.
OPTIMIZER=/l/pyoptimizer/main.py
# Which preprocessor to use. Use 'gcpp' for GNU cpp (typical on Linux);
# use 'mcpp' for mcpp.
PREPROC_KIND=mcpp
# Full path to the preprocessor. Depends on where you have downloaded it.
# If the preprocessor is mcpp and it is in your path, you can leave it as is.
PREPROC_PATH=mcpp
# Command to remove files in your system. Use 'del' for Windows.
RM=rm -f
# Name of the zipped file to generate for SL
SLZIP=AVsitter2.zip
# Name of the zipped file to generate for OpenSim
OSZIP=AVsitter2-oss.zip
# End of configuration area
# Note some of these scripts don't strictly need to be optimized for memory.
OPTIMIZED=[AV]sitA.lslo\
[AV]sitB.lslo\
[AV]adjuster.lslo\
[AV]helper.lslo\
[AV]root-security.lslo\
[AV]root.lslo\
[AV]select.lslo\
Plugins/AVcamera/[AV]camera.lslo\
Plugins/AVcontrol/Xcite!-Sensations/[AV]Xcite!.lslo\
Plugins/AVcontrol/[AV]root-RLV-extra.lslo\
Plugins/AVcontrol/[AV]root-RLV.lslo\
Plugins/AVcontrol/[AV]root-control.lslo\
Plugins/AVfaces/[AV]faces.lslo\
Plugins/AVprop/[AV]menu.lslo\
Plugins/AVprop/[AV]prop.lslo\
Plugins/AVprop/[AV]object.lslo\
Plugins/AVsequence/[AV]sequence.lslo\
Utilities/AVpos-generator.lslo\
Utilities/AVpos-shifter.lslo\
Utilities/Anim-perm-checker.lslo\
Utilities/MLP-converter.lslo\
Utilities/Missing-anim-finder.lslo
UNOPTIMIZED=Plugins/AVcontrol/LockGuard/[AV]LockGuard.lsl\
Plugins/AVcontrol/LockGuard/[AV]LockGuard-object.lsl
OPENSIM=[AV]sitA.oss\
[AV]sitB.oss\
[AV]adjuster.oss\
[AV]helper.oss
all: $(SLZIP) $(OSZIP)
clean:
$(RM) $(SLZIP) $(OSZIP) $(OPTIMIZED) $(OPENSIM)
optimized: $(OPTIMIZED)
opensim: $(OPENSIM)
$(SLZIP): $(OPTIMIZED) $(UNOPTIMIZED)
$(RM) $@
zip $@ $(OPTIMIZED) $(UNOPTIMIZED)
%.lslo: %.lsl
$(PYTHON) $(OPTIMIZER) -H -O addstrings,shrinknames,-extendedglobalexpr -p $(PREPROC_KIND) --precmd=$(PREPROC_PATH) $< -o $@
$(OSZIP): $(OPENSIM)
$(RM) $@
zip $@ $(OPENSIM)
%.oss: %.lsl
$(PYTHON) prepare-for-oss.py $< > $@
.PHONY : all clean optimized