Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #15 from MarwanG/packaging
Packaging
- Loading branch information
Showing
8 changed files
with
115 additions
and
77 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,50 @@ | ||
# where to install | ||
PREFIX = @prefix@ | ||
BINDIR = $(PREFIX)/bin | ||
# where to install the binaries | ||
prefix=/usr/local | ||
exec_prefix=${prefix} | ||
BINDIR=${exec_prefix}/bin | ||
|
||
SRCS = $(wildcard src/*.ml src/*.mli src/*.mll src/*.mly) | ||
TARGS = arbogen | ||
KIND = native # d.byte | ||
FLAGS = -w,Ae,-warn-error,A | ||
# where to install the man page | ||
MANDIR=${prefix}/share/man | ||
|
||
all: $(TARGS) | ||
# other variables set by ./configure | ||
OCAMLC = ocamlc | ||
OCAMLOPT = ocamlopt | ||
OCAMLDEP = ocamldep | ||
OCAMLLEX = ocamllex | ||
OCAMLYACC= ocamlyacc | ||
OCAMLLIB = /usr/lib/ocaml | ||
OCAMLBEST= op | ||
|
||
OCAMLFLAG= -I src/ | ||
|
||
SRCS = src/Options.ml src/Util.ml src/Grammar.ml src/CombSys.ml src/OracleSimple.ml src/Tree.ml src/Gen.ml src/GParser.ml src/ArboLib.ml src/Arbogen.ml | ||
|
||
|
||
all: arbogen | ||
|
||
arbogen: $(SRCS) | ||
mkdir bin | ||
$(OCAMLOPT) $(OCAMLFLAG) -o bin/arbogen $(SRCS) | ||
|
||
arbogen.byte: $(SRCS) | ||
mkdir bin | ||
$(OCAMLC) $(OCAMLFLAG) -o bin/arbogen.byte $(SRCS) | ||
|
||
arbogen: _build/src/Arbogen.$(KIND) | ||
cp $< $@ | ||
|
||
install:: arbogen | ||
mkdir -p $(BINDIR) | ||
mv arbogen $(BINDIR) | ||
mv bin/arbogen $(BINDIR) | ||
mkdir -p $(MANDIR)/man1 | ||
cp -f doc/$(TARGS).1 /usr/local/man/man1/$(TARGS).1 | ||
|
||
_build/src/%.$(KIND): $(SRCS) | ||
ocamlbuild -cflags $(FLAGS) -no-links -I src $*.$(KIND) | ||
|
||
clean: | ||
@ocamlbuild -clean | ||
@rm -f *~ $(TARGS) | ||
rm -f src/*~ | ||
rm -f src/*.cmi | ||
rm -f src/*.cmx | ||
rm -f src/*.cmo | ||
rm -f src/*.o | ||
|
||
.PHONY: all clean | ||
cleanall: clean | ||
rm -f bin/arbogen | ||
rm -f bin/arbogen.byte | ||
rm -rf bin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#!/bin/sh | ||
#cleanup.sh | ||
|
||
if [ -f Makefile ]; then | ||
make cleanall | ||
fi | ||
rm -rf Makefile | ||
rm -rf configure | ||
rm -rf config.status | ||
rm -rf autom4te.cache | ||
rm -rf config.log | ||
rm -rf arbogen_`cat VERSION`_1 | ||
rm -rf *~ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#!/bin/sh | ||
#config.sh | ||
#if output of makefile needs to be a byte pass as parameter arbogen.byte | ||
|
||
if [ -f configure ]; then | ||
echo "checking for configure file... ok" | ||
else | ||
echo "checking for configure file... no" | ||
if which autoconf >/dev/null; then | ||
echo "checking for autoconf... ok" | ||
autoconf | ||
echo "creating configure file... ok" | ||
else | ||
echo "checking for autoconf... no" | ||
exit 1; | ||
fi | ||
fi | ||
|
||
echo "executing configure script" | ||
./configure | ||
|
||
if [ -f Makefile ]; then | ||
echo "checking for Makefile... ok" | ||
make $1 | ||
else | ||
echo "checking for Makefile... no" | ||
echo "error... Aborting" | ||
exit 1; | ||
fi | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.