1 ### Makefile for RIGHT ON COMMAND-LINE
3 ###--------------------------------------------------------------------------
4 ### Configuration stuff.
6 ## Compiling and linking.
10 -O2 -g -Wall -fPIC -funroll-loops -fomit-frame-pointer \
18 tcllibdir = $(prefix)/lib
19 pkglibdir = $(tcllibdir)/elite
20 bindir = $(prefix)/bin
25 ###--------------------------------------------------------------------------
28 ### Shouldn't need to fiddle with this stuff.
34 elite-editor elite-pairs elite-path elite-find elite-map \
35 elite-prices elite-describe elite-reach elite-cmdr elite-salesman \
38 SRCFILES = elite.c vec.c vec.h graph.c
40 PKGFILES = elite.so vec.so graph.so elite.tcl
42 all: $(PKGFILES) pkgIndex.tcl
45 $(LD) $(LDFLAGS) elite.o -o elite.so
47 $(LD) $(LDFLAGS) vec.o -o vec.so
48 graph.so: graph.o vec.so
49 $(LD) $(LDFLAGS) -Wl,-rpath,$(pkglibdir) graph.o vec.so -o graph.so
53 .c.o:; $(CC) -c $(CFLAGS) -o $@ $<
55 pkgIndex.tcl: $(PKGFILES)
56 LD_LIBRARY_PATH=$$(pwd) \
57 echo "pkg_mkIndex -verbose -direct -load Vec . $(PKGFILES) " | \
61 $(INSTALL) -d $(INST)$(bindir) $(INST)$(pkglibdir)
62 $(INSTALL) -m 644 $(PKGFILES) pkgIndex.tcl $(INST)$(pkglibdir)
63 $(INSTALL) -m 755 $(TCLSCRIPTS) $(INST)$(bindir)
66 $(RM) -f *.o *.so pkgIndex.tcl
68 distdir = $(PACKAGE)-$(VERSION)
70 COPYING README Makefile $(SRCFILES) elite.tcl steele.cmdr \
71 elite.def vec.def graph.def $(TCLSCRIPTS) \
72 debian/rules debian/control debian/copyright debian/changelog
75 mkdir $(distdir) $(distdir)/debian
76 for i in $(DISTFILES); do \
80 up=`echo $$dir | sed 's:[^/]\+:..:g'`; \
81 mkdir -p $(distdir)/$$dir;; \
84 ln -s ../$$up/$$i $(distdir)/$$i; \
87 tar chofz $(INST)$(distdir).tar.gz $(distdir)
89 cd $(distdir) && zip -rq ../$(INST)$(distdir).zip .
93 @echo "*** Packing..."
95 @echo "*** Unpacking..."
96 tar xfz $(distdir).tar.gz
97 @echo "*** Test building..."
102 $(MAKE) install INST=inst; \
104 @echo "*** Tidying up..."
108 .PHONY: all install clean dist disttar distzip distdir distcheck
110 ###----- That's all, folks --------------------------------------------------