chiark / gitweb /
Attempt at NT build system.
[rocl] / Makefile.NT
CommitLineData
1fe3f5d7 1# Makefile for RIGHT ON COMMAND-LINE
2#
3# $Id: Makefile.NT,v 1.1 2003/03/18 10:40:56 mdw Exp $
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
35VERSION = 1.1.3
36
37TCLSCRIPTS = \
38 elite-editor elite-pairs elite-path elite-find elite-map \
39 elite-prices elite-describe elite-reach elite-cmdr elite-salesman
40
41SRCFILES = elite.c vec.c vec.h graph.c
42
43PKGFILES = elite.dll vec.dll graph.dll elite.tcl
44
45all: $(PKGFILES) pkgIndex.tcl
46
47elite.dll: elite.o elite.def
48 $(LD) $(LDFLAGS) elite.o elite.def $(LIBS) -o elite.dll
49vec.dll vec.dll.a: vec.o vec.def
50 $(LD) $(LDFLAGS) vec.o vec.def $(LIBS) \
51 -o vec.dll -Wl,--out-implib,vec.dll.a
52graph.dll: graph.o graph.def vec.dll.a
53 $(LD) $(LDFLAGS) graph.o graph.def $(LIBS) vec.dll.a -o graph.dll
54graph.o vec.o: vec.h
55
56.SUFFIXES: .c .o
57.c.o:; $(CC) -c $(CFLAGS) -o $@ $<
58
59pkgIndex.tcl: $(PKGFILES)
60 echo "pkg_mkIndex -verbose -direct -load Vec -load vector . " | tclsh
61
62install: all
63 $(INSTALL) -d $(INST)$(bindir) $(INST)$(pkglibdir)
64 $(INSTALL) -m 644 $(PKGFILES) pkgIndex.tcl $(INST)$(pkglibdir)
65 $(INSTALL) -m 755 $(TCLSCRIPTS) $(INST)$(bindir)
66
67clean:
68 $(RM) -f *.o *.dll pkgIndex.tcl
69
70DISTDIR = $(PACKAGE)-$(VERSION)
71DISTFILES = README Makefile $(SRCFILES) elite.tcl elite.def $(TCLSCRIPTS)
72distdir: $(DISTFILES)
73 $(RM) -rf $(DISTDIR)
74 mkdir $(DISTDIR)
75 for i in $(DISTFILES); do ln -s ../$$i $(DISTDIR); done
76disttar: distdir
77 tar chofz $(DISTDIR).tar.gz $(DISTDIR)
78distzip: distdir
79 cd $(DISTDIR) && zip -rq ../$(DISTDIR).zip .
80dist: disttar distzip
81 $(RM) -rf $(DISTDIR)
82distcheck: dist
83 @echo "*** Packing..."
84 $(MAKE) dist
85 @echo "*** Unpacking..."
86 tar xfz $(DISTDIR).tar.gz
87 @echo "*** Test building..."
88 set -e; \
89 cd $(DISTDIR); \
90 $(MAKE) clean; \
91 $(MAKE); \
92 $(MAKE) install INST=inst; \
93 $(MAKE) dist
94 @echo "*** Tidying up..."
95 rm -rf $(DISTDIR)
96 @echo "*** All OK"
97
98.PHONY: all install clean dist disttar distzip distdir distcheck
99
100#----- That's all, folks ----------------------------------------------------