1 # Makefile for RIGHT ON COMMAND-LINE
3 # $Id: Makefile,v 1.9 2003/03/07 20:04:21 mdw Exp $
5 #----- Configuration stuff --------------------------------------------------
7 # --- Compiling and linking ---
12 -O2 -g -pedantic -Wall -funroll-loops -fomit-frame-pointer \
17 # --- Installation ---
21 tcllibdir = $(prefix)/lib
22 pkglibdir = $(tcllibdir)/elite
23 bindir = $(prefix)/bin
28 #----- Main machinery -------------------------------------------------------
30 # Shouldn't need to fiddle with thiis stuff.
36 elite-editor elite-pairs elite-path elite-find elite-map \
37 elite-prices elite-describe elite-reach elite-cmdr elite-salesman
39 SRCFILES = elite.c vec.c vec.h graph.c
41 PKGFILES = elite.so vec.so graph.so elite.tcl
43 all: $(PKGFILES) pkgIndex.tcl
46 $(LD) $(LDFLAGS) elite.o -o elite.so
48 $(LD) $(LDFLAGS) vec.o -o vec.so
50 $(LD) $(LDFLAGS) graph.o -o graph.so
54 .c.o:; $(CC) -c $(CFLAGS) -o $@ $<
56 pkgIndex.tcl: $(PKGFILES)
57 echo "pkg_mkIndex -verbose -direct -load Vec . $(PKGFILES) " | tclsh
60 $(INSTALL) -d $(INST)$(bindir) $(INST)$(pkglibdir)
61 $(INSTALL) -m 644 $(PKGFILES) pkgIndex.tcl $(INST)$(pkglibdir)
62 $(INSTALL) -m 755 $(TCLSCRIPTS) $(INST)$(bindir)
65 $(RM) -f *.o *.so pkgIndex.tcl
67 DISTDIR = $(PACKAGE)-$(VERSION)
68 DISTFILES = README Makefile $(SRCFILES) elite.tcl elite.def $(TCLSCRIPTS)
72 for i in $(DISTFILES); do ln -s ../$$i $(DISTDIR); done
74 tar chofz $(DISTDIR).tar.gz $(DISTDIR)
76 cd $(DISTDIR) && zip -rq ../$(DISTDIR).zip .
80 @echo "*** Packing..."
82 @echo "*** Unpacking..."
83 tar xfz $(DISTDIR).tar.gz
84 @echo "*** Test building..."
89 $(MAKE) install INST=inst; \
91 @echo "*** Tidying up..."
95 .PHONY: all install clean dist disttar distzip distdir distcheck
97 #----- That's all, folks ----------------------------------------------------