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