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