| 1 | # Makefile for RIGHT ON COMMAND-LINE |
| 2 | |
| 3 | #----- Configuration stuff -------------------------------------------------- |
| 4 | |
| 5 | # --- Compiling and linking --- |
| 6 | |
| 7 | CC = gcc |
| 8 | INCLUDES = |
| 9 | CFLAGS = -O2 -g -pedantic -Wall $(INCLUDES) |
| 10 | LD = gcc |
| 11 | LDFLAGS = -shared |
| 12 | |
| 13 | # --- Installation --- |
| 14 | |
| 15 | INST = |
| 16 | prefix = /usr/local |
| 17 | tcllibdir = $(prefix)/lib |
| 18 | pkglibdir = $(tcllibdir)/elite |
| 19 | bindir = $(prefix)/bin |
| 20 | |
| 21 | INSTALL = install |
| 22 | RM = rm |
| 23 | |
| 24 | #----- Main machinery ------------------------------------------------------- |
| 25 | # |
| 26 | # Shouldn't need to fiddle with thiis stuff. |
| 27 | |
| 28 | PACKAGE = rocl |
| 29 | VERSION = 1.0.0 |
| 30 | |
| 31 | TCLSCRIPTS = \ |
| 32 | elite-editor elite-pairs elite-path elite-find elite-map \ |
| 33 | elite-prices elite-describe elite-reach |
| 34 | |
| 35 | all: elite.so pkgIndex.tcl |
| 36 | |
| 37 | elite.so: elite.o |
| 38 | $(LD) $(LDFLAGS) elite.o -o elite.so |
| 39 | |
| 40 | .SUFFIXES: .c .o |
| 41 | .c.o:; $(CC) -c $(CFLAGS) -o $@ $< |
| 42 | |
| 43 | pkgIndex.tcl: elite.so elite.tcl |
| 44 | echo "pkg_mkIndex -verbose -direct . elite.so elite.tcl" | tclsh |
| 45 | |
| 46 | install: all |
| 47 | $(INSTALL) -d $(INST)$(bindir) $(INST)$(pkglibdir) |
| 48 | $(INSTALL) -m 644 elite.so elite.tcl pkgIndex.tcl $(INST)$(pkglibdir) |
| 49 | $(INSTALL) -m 755 $(TCLSCRIPTS) $(INST)$(bindir) |
| 50 | |
| 51 | clean: |
| 52 | $(RM) -f elite.o elite.so pkgIndex.tcl |
| 53 | |
| 54 | DISTDIR = $(PACKAGE)-$(VERSION) |
| 55 | DISTFILES = README Makefile elite.c elite.def $(TCLSCRIPTS) |
| 56 | distdir: $(DISTFILES) |
| 57 | $(RM) -rf $(DISTDIR) |
| 58 | mkdir $(DISTDIR) |
| 59 | for i in $(DISTFILES); do ln -s ../$$i $(DISTDIR); done |
| 60 | dist: distdir |
| 61 | tar chofz $(DISTDIR).tar.gz $(DISTDIR) |
| 62 | $(RM) -rf $(DISTDIR) |
| 63 | |
| 64 | .PHONY: all install clean dist distdir |
| 65 | |
| 66 | #----- That's all, folks ---------------------------------------------------- |