1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69
|
### User-configurable section begins
# Installation directory prefix for Debian GNU/Linux
DESTDIR =
# Installation directory prefix for other systems
PREFIX = $(DESTDIR)/usr
#PREFIX = $(DESTDIR)/usr/local
# Where to put binaries on 'make install'?
BINDIR = $(PREFIX)/bin
# Where to put manual pages on 'make installman'?
MANDIR = $(PREFIX)/share/man/man1
## Installation commands
RM = rm -f
INSTALLDIR = install -d
INSTALLDATA = install -m 444
INSTALLBIN = install
## C compiler and its options
#CC = gcc
#CFLAGS = -Wall -ansi -pedantic -O3 -fomit-frame-pointer
### User-configurable section ends
TARGET = c2n
MANPAGES = c2n.1
SRCS = c2n.c decode.c encode.c oric_d.c oric_e.c
HDRS = $(SRCS:.c=.h)
OBJS = $(SRCS:.c=.o)
LIBS = -lm
all: depend $(TARGET)
clean:
$(RM) $(OBJS)
reallyclean: clean
$(RM) $(TARGET)
install: $(TARGET)
$(INSTALLDIR) $(BINDIR)
$(INSTALLBIN) $(TARGET) $(BINDIR)
installman: $(MANPAGES)
$(INSTALLDIR) $(MANDIR)
$(INSTALLDATA) $(MANPAGES) $(MANDIR)
depend: $(SRCS) $(HDRS)
$(CC) -MM $(SRCS) > depend
$(TARGET): $(OBJS)
$(CC) $(LDFLAGS) -o $@ $(OBJS) $(LIBS)
.phony: all clean reallyclean install installman
.SUFFIXES:
.SUFFIXES: .o .c .1 .dvi .pdf .txt
.c.o:
$(CC) $(CFLAGS) -c $< -o $@
.1.dvi:
groff -man -Tdvi $< > $@
.dvi.pdf:
dvipdfm $<
.1.txt:
groff -man -Tlatin1 $< | sed -e 's/.//g;' > $@
include depend
|