# This Makefile has been tested with GNU make and /usr/ccs/bin/make # on a Solaris 2.6 (SunOS 5.6) system. CC=gcc COPT=-O2 CFLAGS=-Wall $(COPT) -ansi -fpack-struct # -pedantic complains about some perfectly harmless signed/unsigned # char pointer stuff. # Note: -fpack-struct works on gcc's at least as old as 2.95.3 # If you're not using gcc, find your compiler's equivalent option # (/Zp on Microsoft compilers). DESTDIR= PREFIX=/usr/local BINDIR=$(PREFIX)/bin MANDIR=$(PREFIX)/man MAN1DIR=$(MANDIR)/man1 # some systems need this instead: #MANDIR=$(PREFIX)/share/man # Comment out next line if your system does not support gzip'ed man pages GZIP_MAN=y # Some distros have this with a .py extension, some don't. Only needed # if you're rebuilding the man pages (users shouldn't have to). # RST2MAN=rst2man.py RST2MAN=rst2man EXES=atrdir atrextr makeatr sortatr unmakatr MANS=atrdir.1 atrextr.1 makeatr.1 sortatr.1 unmakatr.1 all: $(EXES) $(MANS) %.1: %.rst manhdr.rst manftr.rst $(RST2MAN) $< > $@ clean: rm -f $(EXES) atr.o tags *~ *.bak install: all mkdir -p $(DESTDIR)$(BINDIR) $(DESTDIR)$(MAN1DIR) ;\ for exe in $(EXES) ; do \ strip $$exe ;\ cp $$exe $(DESTDIR)$(BINDIR)/$$exe ;\ done ;\ for man in $(MANS) ; do \ if [ "$(GZIP_MAN)" = "y" ]; then \ gzip -c < $$man > $(DESTDIR)$(MAN1DIR)/$$man.gz ;\ else \ cp $$man $(DESTDIR)$(MAN1DIR) ; \ fi ;\ done atr.o: atr.c atr.h atdos.h kboot.h atrdir: atrdir.c atr.o atrextr: atrextr.c atr.o makeatr: makeatr.c atr.o sortatr: sortatr.c atr.o unmakatr: unmakatr.c atr.o