Attempt at NT build system.
authormdw <mdw>
Tue, 18 Mar 2003 10:40:56 +0000 (10:40 +0000)
committermdw <mdw>
Tue, 18 Mar 2003 10:40:56 +0000 (10:40 +0000)
Makefile.NT [new file with mode: 0644]

diff --git a/Makefile.NT b/Makefile.NT
new file mode 100644 (file)
index 0000000..619ae1a
--- /dev/null
@@ -0,0 +1,100 @@
+# Makefile for RIGHT ON COMMAND-LINE
+#
+# $Id: Makefile.NT,v 1.1 2003/03/18 10:40:56 mdw Exp $
+
+#----- Configuration stuff --------------------------------------------------
+
+# --- Compiling and linking ---
+
+CC = gcc
+TCLDIR = /cygdrive/d/Tcl
+INCLUDES = -I$(TCLDIR)/include
+LIBS = $(TCLDIR)/lib/tcl84.lib
+CFLAGS = \
+       -O2 -g -pedantic -Wall -funroll-loops -fomit-frame-pointer \
+       $(INCLUDES)
+LD = gcc
+LDFLAGS = -shared
+
+# --- Installation ---
+
+INST =
+prefix = /usr/local
+tcllibdir = $(prefix)/lib
+pkglibdir = $(tcllibdir)/elite
+bindir = $(prefix)/bin
+
+INSTALL = install
+RM = rm
+
+#----- Main machinery -------------------------------------------------------
+#
+# Shouldn't need to fiddle with thiis stuff.
+
+PACKAGE = rocl
+VERSION = 1.1.3
+
+TCLSCRIPTS = \
+       elite-editor elite-pairs elite-path elite-find elite-map \
+       elite-prices elite-describe elite-reach elite-cmdr elite-salesman
+
+SRCFILES = elite.c vec.c vec.h graph.c
+
+PKGFILES = elite.dll vec.dll graph.dll elite.tcl
+
+all: $(PKGFILES) pkgIndex.tcl
+
+elite.dll: elite.o elite.def
+       $(LD) $(LDFLAGS) elite.o elite.def $(LIBS) -o elite.dll
+vec.dll vec.dll.a: vec.o vec.def
+       $(LD) $(LDFLAGS) vec.o vec.def $(LIBS) \
+               -o vec.dll -Wl,--out-implib,vec.dll.a
+graph.dll: graph.o graph.def vec.dll.a 
+       $(LD) $(LDFLAGS) graph.o graph.def $(LIBS) vec.dll.a -o graph.dll
+graph.o vec.o: vec.h
+
+.SUFFIXES: .c .o
+.c.o:; $(CC) -c $(CFLAGS) -o $@ $<
+
+pkgIndex.tcl: $(PKGFILES)
+       echo "pkg_mkIndex -verbose -direct -load Vec -load vector .  " | tclsh
+
+install: all
+       $(INSTALL) -d $(INST)$(bindir) $(INST)$(pkglibdir)
+       $(INSTALL) -m 644 $(PKGFILES) pkgIndex.tcl $(INST)$(pkglibdir)
+       $(INSTALL) -m 755 $(TCLSCRIPTS) $(INST)$(bindir)
+
+clean:
+       $(RM) -f *.o *.dll pkgIndex.tcl
+
+DISTDIR = $(PACKAGE)-$(VERSION)
+DISTFILES = README Makefile $(SRCFILES) elite.tcl elite.def $(TCLSCRIPTS)
+distdir: $(DISTFILES)
+       $(RM) -rf $(DISTDIR)
+       mkdir $(DISTDIR)
+       for i in $(DISTFILES); do ln -s ../$$i $(DISTDIR); done
+disttar: distdir
+       tar chofz $(DISTDIR).tar.gz $(DISTDIR)
+distzip: distdir
+       cd $(DISTDIR) && zip -rq ../$(DISTDIR).zip .
+dist: disttar distzip
+       $(RM) -rf $(DISTDIR)
+distcheck: dist
+       @echo "*** Packing..."
+       $(MAKE) dist
+       @echo "*** Unpacking..."
+       tar xfz $(DISTDIR).tar.gz
+       @echo "*** Test building..."
+       set -e; \
+       cd $(DISTDIR); \
+       $(MAKE) clean; \
+       $(MAKE); \
+       $(MAKE) install INST=inst; \
+       $(MAKE) dist
+       @echo "*** Tidying up..."
+       rm -rf $(DISTDIR)
+       @echo "*** All OK"
+
+.PHONY: all install clean dist disttar distzip distdir distcheck
+
+#----- That's all, folks ----------------------------------------------------