chiark / gitweb /
Fix nonexistent planet error. Make staying put cost nothing.
[rocl] / Makefile
... / ...
CommitLineData
1# Makefile for RIGHT ON COMMAND-LINE
2#
3# $Id: Makefile,v 1.9 2003/03/07 20:04:21 mdw Exp $
4
5#----- Configuration stuff --------------------------------------------------
6
7# --- Compiling and linking ---
8
9CC = gcc
10INCLUDES =
11CFLAGS = \
12 -O2 -g -pedantic -Wall -funroll-loops -fomit-frame-pointer \
13 $(INCLUDES)
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
33VERSION = 1.1.1
34
35TCLSCRIPTS = \
36 elite-editor elite-pairs elite-path elite-find elite-map \
37 elite-prices elite-describe elite-reach elite-cmdr elite-salesman
38
39SRCFILES = elite.c vec.c vec.h graph.c
40
41PKGFILES = elite.so vec.so graph.so elite.tcl
42
43all: $(PKGFILES) pkgIndex.tcl
44
45elite.so: elite.o
46 $(LD) $(LDFLAGS) elite.o -o elite.so
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
52
53.SUFFIXES: .c .o
54.c.o:; $(CC) -c $(CFLAGS) -o $@ $<
55
56pkgIndex.tcl: $(PKGFILES)
57 echo "pkg_mkIndex -verbose -direct -load Vec . $(PKGFILES) " | tclsh
58
59install: all
60 $(INSTALL) -d $(INST)$(bindir) $(INST)$(pkglibdir)
61 $(INSTALL) -m 644 $(PKGFILES) pkgIndex.tcl $(INST)$(pkglibdir)
62 $(INSTALL) -m 755 $(TCLSCRIPTS) $(INST)$(bindir)
63
64clean:
65 $(RM) -f *.o *.so pkgIndex.tcl
66
67DISTDIR = $(PACKAGE)-$(VERSION)
68DISTFILES = README Makefile $(SRCFILES) elite.tcl elite.def $(TCLSCRIPTS)
69distdir: $(DISTFILES)
70 $(RM) -rf $(DISTDIR)
71 mkdir $(DISTDIR)
72 for i in $(DISTFILES); do ln -s ../$$i $(DISTDIR); done
73disttar: distdir
74 tar chofz $(DISTDIR).tar.gz $(DISTDIR)
75distzip: distdir
76 cd $(DISTDIR) && zip -rq ../$(DISTDIR).zip .
77dist: disttar distzip
78 $(RM) -rf $(DISTDIR)
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
96
97#----- That's all, folks ----------------------------------------------------