1 # Makefile for RIGHT ON COMMAND-LINE
3 # $Id: Makefile,v 1.12 2003/03/18 10:43:55 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)
69 README Makefile $(SRCFILES) elite.tcl \
70 elite.def vec.def graph.def $(TCLSCRIPTS)
74 for i in $(DISTFILES); do ln -s ../$$i $(DISTDIR); done
76 tar chofz $(DISTDIR).tar.gz $(DISTDIR)
78 cd $(DISTDIR) && zip -rq ../$(DISTDIR).zip .
82 @echo "*** Packing..."
84 @echo "*** Unpacking..."
85 tar xfz $(DISTDIR).tar.gz
86 @echo "*** Test building..."
91 $(MAKE) install INST=inst; \
93 @echo "*** Tidying up..."
97 .PHONY: all install clean dist disttar distzip distdir distcheck
99 #----- That's all, folks ----------------------------------------------------