Skip to content

Commit

Permalink
Initial import. This project was started on Thu Feb 24 14:12:50 2005
Browse files Browse the repository at this point in the history
UTC and kept in sourceforge CVS.  There was a problem accessing CVS
after this time (!) however so I ditched the history (not so important
anyway).
  • Loading branch information
Chris00 committed Mar 12, 2009
0 parents commit 62be3ea
Show file tree
Hide file tree
Showing 18 changed files with 3,010 additions and 0 deletions.
12 changes: 12 additions & 0 deletions .bzrignore
@@ -0,0 +1,12 @@
*.cmi
*.cmo
*.cma
*.cmx
*.cmxa
*.annot
*.exe
*.opt
rfc1179.html
rfc1179.html.gz
Makefile.pub
doc
9 changes: 9 additions & 0 deletions .depend
@@ -0,0 +1,9 @@
lpd.cmi: socket.cmi
lpd.cmo: socket.cmi lpd.cmi
lpd.cmx: socket.cmx lpd.cmi
lpd_to_win.cmo: socket.cmi lpd.cmi
lpd_to_win.cmx: socket.cmx lpd.cmx
page_counter.cmo: socket.cmi lpd.cmi
page_counter.cmx: socket.cmx lpd.cmx
socket.cmo: socket.cmi
socket.cmx: socket.cmi
32 changes: 32 additions & 0 deletions INSTALL
@@ -0,0 +1,32 @@

INSTALLATION INSTRUCTIONS
----------------------------------------------------------------------

Build the library:

$ make

(For win32 users, a BAT file does it for you. You have to perform the
following steps by hand however.)

To build the example programs (you may want to look at the beginning
of the ml files to configure them):

$ make ex


Install it (requires findlib):

$ make install

Remove the installed library (requires findlib):

$ make uninstall

Clean up the build and examples directory:

$ make clean


"findlib" is available at
http://www.ocaml-programming.de/programming/download-caml.html
523 changes: 523 additions & 0 deletions LICENSE

Large diffs are not rendered by default.

8 changes: 8 additions & 0 deletions META
@@ -0,0 +1,8 @@
# Specifications for the Lpd module -*-shell-script-*-
name = "Lpd"
version = "0.9"
description = "Line printer deamon."
requires = "unix"
archive(byte) = "socket.cma lpd.cma"
archive(native) = "socket.cmxa lpd.cmxa"
# Program(byte) = "lpd.exe"
12 changes: 12 additions & 0 deletions Make.bat
@@ -0,0 +1,12 @@
REM Compile the project under windows (without needing "make")

SET OCAMLC=ocamlc
SET OCAMLCFLAGS=-dtypes
SET LIBS=unix.cma -I +threads threads.cma
SET PGM=lpd_to_win

%OCAMLC% %OCAMLCFLAGS% -c socket.mli
%OCAMLC% %OCAMLCFLAGS% -c socket.ml
%OCAMLC% %OCAMLCFLAGS% -c lpd.mli
%OCAMLC% %OCAMLCFLAGS% -c lpd.ml
%OCAMLC% %OCAMLCFLAGS% -o %PGM%.exe %LIBS% socket.cmo lpd.cmo %PGM%.ml
135 changes: 135 additions & 0 deletions Makefile
@@ -0,0 +1,135 @@
# $Id: Makefile,v 1.7 2007/02/15 23:38:51 chris_77 Exp $

PKGNAME = $(shell grep "name" META | sed -e "s/.*\"\([^\"]*\)\".*/\1/")
PKGVERSION = $(shell grep "version" META | sed -e "s/.*\"\([^\"]*\)\".*/\1/")

SRC_WEB = web
SF_WEB = /home/groups/o/oc/ocaml-lpd/htdocs

CAMLPATH =
OCAMLC = $(CAMLPATH)ocamlc
OCAMLP4 = $(CAMLPATH)camlp4o
OCAMLOPT = $(CAMLPATH)ocamlopt
OCAMLDEP = $(CAMLPATH)ocamldep
OCAMLDOC = $(CAMLPATH)ocamldoc

OCAMLCFLAGS = -dtypes
OCAMLOPTFLAGS = -dtypes -inline 3
OCAMLDOCFLAGS = -html -stars -colorize-code #-css-style $(OCAMLDOCCSS)

DISTFILES = INSTALL LICENSE META Make.bat Makefile hosts.lpd \
$(wildcard *.ml) $(wildcard *.mli)

MLI_FILES = $(wildcard *.mli)
DOCFILES = lpd.mli socket.mli

PKG_TARBALL = $(PKGNAME)-$(PKGVERSION).tar.gz
ARCHIVE = $(shell grep "archive(byte)" META | \
sed -e "s/.*\"\([^\"]*\)\".*/\1/")
XARCHIVE = $(shell grep "archive(native)" META | \
sed -e "s/.*\"\([^\"]*\)\".*/\1/")

default: all

######################################################################

PKGS = $(shell grep "requires" META | sed -e "s/.*\"\([^\"]*\)\".*/\1/")
PKGS_CMA = $(addsuffix .cma, $(PKGS))
PKGS_CMXA = $(addsuffix .cmxa, $(PKGS))

CMI_FILES = $(MLI_FILES:.mli=.cmi)

.PHONY: all byte opt install install-byte install-opt doc dist
all: byte opt
byte: socket.cma lpd.cma
opt: socket.cmxa lpd.cmxa


# Make the examples
.PHONY: ex examples
ex: lpd_to_win.exe page_counter.exe

%.exe: socket.cma lpd.cma %.ml
$(OCAMLC) $(OCAMLCFLAGS) -o $@ -I +threads $(PKGS_CMA) threads.cma $^
%.opt: socket.cmxa lpd.cmxa %.ml
$(OCAMLOPT) $(OCAMLOPTFLAGS) -o $@ -I +threads \
$(PKGS_CMXA) threads.cmxa $^

# (Un)installation
.PHONY: install uninstall
install: all
ocamlfind remove $(PKGNAME); \
[ -f "$(XARCHIVE)" ] && \
extra="$(XARCHIVE) $(addsuffix .a,$(basename $(XARCHIVE)))"; \
ocamlfind install $(if $(DESTDIR),-destdir $(DESTDIR)) $(PKGNAME) \
$(MLI_FILES) $(CMI_FILES) $(ARCHIVE) META $$extra

installbyte:
ocamlfind remove $(PKGNAME); \
ocamlfind install $(if $(DESTDIR),-destdir $(DESTDIR)) $(PKGNAME) \
$(MLI_FILES) $(CMI_FILES) $(ARCHIVE) META

uninstall:
ocamlfind remove $(PKGNAME)

# Compile HTML documentation
DOC_DIR=doc
doc: $(DOCFILES) $(CMI_FILES)
@if [ -n "$(DOCFILES)" ] ; then \
if [ ! -x $(DOC_DIR) ] ; then mkdir $(DOC_DIR) ; fi ; \
$(OCAMLDOC) -v -d $(DOC_DIR) $(OCAMLDOCFLAGS) $(DOCFILES) ; \
fi

# Make a tarball
.PHONY: dist
dist:
mkdir $(PKGNAME)-$(PKGVERSION)
cp -r $(DISTFILES) $(PKGNAME)-$(PKGVERSION)/
# Create a trivial hosts.lpd
# echo "# hosts.lpd\nmachine.network.com" \
# > $(PKGNAME)-$(PKGVERSION)/hosts.lpd
tar --exclude "CVS" --exclude ".cvsignore" --exclude "*~" \
--exclude "*.cm{i,x,o,xa}" --exclude "*.o" \
-zcvf $(PKG_TARBALL) $(PKGNAME)-$(PKGVERSION)
rm -rf $(PKGNAME)-$(PKGVERSION)

# Release a tarball and publish the HTML doc
-include Makefile.pub


# Generic compilation instructions.

%.cmi: %.mli
$(OCAMLC) $(OCAMLCFLAGS) -c $<

%.cmo: %.ml
$(OCAMLC) $(OCAMLCFLAGS) -c $<

%.cma: %.ml %.cmi
$(OCAMLC) -a -o $@ $(OCAMLCFLAGS) $<

%.cmx: %.ml
$(OCAMLOPT) $(OCAMLOPTFLAGS) -c $<

%.cmxa: %.ml %.cmi
$(OCAMLOPT) -a -o $@ $(OCAMLOPTFLAGS) $<

.PHONY: dep depend
dep: .depend
depend: .depend

.depend: $(wildcard *.mli) $(wildcard *.ml) $(wildcard */*.ml)
ocamldep $^ > $@

ifeq ($(wildcard .depend),.depend)
include .depend
endif


.PHONY:clean
clean:
rm -f *~ .*~ *.{o,a} *.cm[aiox] *.cmxa *.annot
rm -rf $(DOC_DIR) $(PKG_TARBALL)
find . -type f -perm -u=x -exec rm -f {} \;

.SUFFIXES: .ml .mli .cmi .cmo
13 changes: 13 additions & 0 deletions hosts.lpd
@@ -0,0 +1,13 @@
# hosts.lpd (authorized hosts or IP addresses to print) -*-conf-*-
abel.swapping.umh.ac.be
poincare.swapping.umh.ac.be poincare
math.swapping.umh.ac.be
math4.swapping.umh.ac.be
euler.swapping.umh.ac.be
mathwifi.swapping.umh.ac.be
# Informatique
sgl17.swapping.umh.ac.be sgl15.swapping.umh.ac.be
si-vero.swapping.umh.ac.be
# Olivier
turing turing2
pascal.umh.ac.be

0 comments on commit 62be3ea

Please sign in to comment.