chiark / gitweb /
Whoops.
[rocl] / Makefile
CommitLineData
1304202a 1# Makefile for RIGHT ON COMMAND-LINE
74dd4846 2#
1ded87ba 3# $Id: Makefile,v 1.4 2003/03/01 17:47:07 mdw Exp $
1304202a 4
5#----- Configuration stuff --------------------------------------------------
6
7# --- Compiling and linking ---
8
9CC = gcc
10INCLUDES =
11CFLAGS = -O2 -g -pedantic -Wall $(INCLUDES)
12LD = gcc
13LDFLAGS = -shared
14
15# --- Installation ---
16
17INST =
18prefix = /usr/local
19tcllibdir = $(prefix)/lib
20pkglibdir = $(tcllibdir)/elite
21bindir = $(prefix)/bin
22
23INSTALL = install
24RM = rm
25
26#----- Main machinery -------------------------------------------------------
27#
28# Shouldn't need to fiddle with thiis stuff.
29
30PACKAGE = rocl
40896f55 31VERSION = 1.0.1
1304202a 32
33TCLSCRIPTS = \
34 elite-editor elite-pairs elite-path elite-find elite-map \
1ded87ba 35 elite-prices elite-describe elite-reach elite-cmdr
1304202a 36
37all: elite.so pkgIndex.tcl
38
39elite.so: elite.o
40 $(LD) $(LDFLAGS) elite.o -o elite.so
41
42.SUFFIXES: .c .o
43.c.o:; $(CC) -c $(CFLAGS) -o $@ $<
44
45pkgIndex.tcl: elite.so elite.tcl
46 echo "pkg_mkIndex -verbose -direct . elite.so elite.tcl" | tclsh
47
48install: all
49 $(INSTALL) -d $(INST)$(bindir) $(INST)$(pkglibdir)
50 $(INSTALL) -m 644 elite.so elite.tcl pkgIndex.tcl $(INST)$(pkglibdir)
51 $(INSTALL) -m 755 $(TCLSCRIPTS) $(INST)$(bindir)
52
53clean:
54 $(RM) -f elite.o elite.so pkgIndex.tcl
55
56DISTDIR = $(PACKAGE)-$(VERSION)
74dd4846 57DISTFILES = README Makefile elite.c elite.tcl elite.def $(TCLSCRIPTS)
1304202a 58distdir: $(DISTFILES)
59 $(RM) -rf $(DISTDIR)
60 mkdir $(DISTDIR)
61 for i in $(DISTFILES); do ln -s ../$$i $(DISTDIR); done
74dd4846 62disttar: distdir
1304202a 63 tar chofz $(DISTDIR).tar.gz $(DISTDIR)
74dd4846 64distzip: distdir
65 cd $(DISTDIR) && zip -rq ../$(DISTDIR).zip .
66dist: disttar distzip
1304202a 67 $(RM) -rf $(DISTDIR)
74dd4846 68distcheck: dist
69 @echo "*** Packing..."
70 $(MAKE) dist
71 @echo "*** Unpacking..."
72 tar xfz $(DISTDIR).tar.gz
73 @echo "*** Test building..."
74 set -e; \
75 cd $(DISTDIR); \
76 $(MAKE) clean; \
77 $(MAKE); \
78 $(MAKE) install INST=inst; \
79 $(MAKE) dist
80 @echo "*** Tidying up..."
81 rm -rf $(DISTDIR)
82 @echo "*** All OK"
83
84.PHONY: all install clean dist disttar distzip distdir distcheck
1304202a 85
86#----- That's all, folks ----------------------------------------------------