# Makefile for RIGHT ON COMMAND-LINE #----- Configuration stuff -------------------------------------------------- # --- Compiling and linking --- CC = gcc INCLUDES = CFLAGS = -O2 -g -pedantic -Wall $(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.0.0 TCLSCRIPTS = \ elite-editor elite-pairs elite-path elite-find elite-map \ elite-prices elite-describe elite-reach all: elite.so pkgIndex.tcl elite.so: elite.o $(LD) $(LDFLAGS) elite.o -o elite.so .SUFFIXES: .c .o .c.o:; $(CC) -c $(CFLAGS) -o $@ $< pkgIndex.tcl: elite.so elite.tcl echo "pkg_mkIndex -verbose -direct . elite.so elite.tcl" | tclsh install: all $(INSTALL) -d $(INST)$(bindir) $(INST)$(pkglibdir) $(INSTALL) -m 644 elite.so elite.tcl pkgIndex.tcl $(INST)$(pkglibdir) $(INSTALL) -m 755 $(TCLSCRIPTS) $(INST)$(bindir) clean: $(RM) -f elite.o elite.so pkgIndex.tcl DISTDIR = $(PACKAGE)-$(VERSION) DISTFILES = README Makefile elite.c elite.def $(TCLSCRIPTS) distdir: $(DISTFILES) $(RM) -rf $(DISTDIR) mkdir $(DISTDIR) for i in $(DISTFILES); do ln -s ../$$i $(DISTDIR); done dist: distdir tar chofz $(DISTDIR).tar.gz $(DISTDIR) $(RM) -rf $(DISTDIR) .PHONY: all install clean dist distdir #----- That's all, folks ----------------------------------------------------