| 1 |
# Makefile for idle3-tools |
| 2 |
|
| 3 |
# DESTDIR is for non root installs (eg packages, NFS) only! |
| 4 |
DESTDIR = |
| 5 |
|
| •6 |
binprefix = /usr |
| 7 |
manprefix = /usr |
| 8 |
exec_prefix = $(binprefix)/ |
| 9 |
sbindir = $(exec_prefix)sbin |
| 10 |
mandir = $(manprefix)/share/man |
| 11 |
oldmandir = $(manprefix)/man |
| 12 |
|
| 13 |
CC ?= gcc |
| 14 |
STRIP ?= strip |
| 15 |
|
| 16 |
CFLAGS := -g -O2 -W -Wall -Wbad-function-cast -Wcast-align -Wpointer-arith -Wcast-qual -Wshadow -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -fkeep-inline-functions -Wwrite-strings -Waggregate-return -Wnested-externs -Wtrigraphs $(CFLAGS) |
| 17 |
|
| 18 |
LDFLAGS = -s |
| 19 |
#LDFLAGS = -s -static |
| 20 |
INSTALL = install |
| 21 |
INSTALL_DATA = $(INSTALL) -m 644 |
| 22 |
INSTALL_DIR = $(INSTALL) -m 755 -d |
| 23 |
INSTALL_PROGRAM = $(INSTALL) |
| 24 |
|
| 25 |
OBJS = idle3ctl.o sgio.o |
| 26 |
|
| 27 |
all: idle3ctl |
| 28 |
|
| 29 |
idle3ctl: $(OBJS) |
| •30 |
$(CC) $(LDFLAGS) $(CFLAGS) -o idle3ctl $(OBJS) |
| 31 |
#$(STRIP) idle3ctl |
| 32 |
|
| 33 |
idle3ctl.o: idle3ctl.c sgio.h |
| 34 |
|
| 35 |
sgio.o: sgio.c sgio.h |
| 36 |
|
| 37 |
install: all idle3ctl.8 |
| 38 |
if [ ! -z $(DESTDIR) ]; then $(INSTALL_DIR) $(DESTDIR) ; fi |
| 39 |
if [ ! -z $(DESTDIR)$(sbindir) ]; then $(INSTALL_DIR) $(DESTDIR)$(sbindir) ; fi |
| 40 |
if [ ! -z $(DESTDIR)$(mandir) ]; then $(INSTALL_DIR) $(DESTDIR)$(mandir) ; fi |
| 41 |
if [ ! -z $(DESTDIR)$(mandir)/man8/ ]; then $(INSTALL_DIR) $(DESTDIR)$(mandir)/man8/ ; fi |
| 42 |
if [ -f $(DESTDIR)$(sbindir)/idle3ctl ]; then rm -f $(DESTDIR)$(sbindir)/idle3ctl ; fi |
| 43 |
if [ -f $(DESTDIR)$(mandir)/man8/idle3ctl.8 ]; then rm -f $(DESTDIR)$(mandir)/man8/idle3ctl.8 ;\ |
| 44 |
elif [ -f $(DESTDIR)$(oldmandir)/man8/idle3ctl.8 ]; then rm -f $(DESTDIR)$(oldmandir)/man8/idle3ctl.8 ; fi |
| 45 |
$(INSTALL_PROGRAM) -D idle3ctl $(DESTDIR)$(sbindir)/idle3ctl |
| 46 |
if [ -d $(DESTDIR)$(mandir) ]; then $(INSTALL_DATA) -D idle3ctl.8 $(DESTDIR)$(mandir)/man8/idle3ctl.8 ;\ |
| 47 |
elif [ -d $(DESTDIR)$(oldmandir) ]; then $(INSTALL_DATA) -D idle3ctl.8 $(DESTDIR)$(oldmandir)/man8/idle3ctl.8 ; fi |
| 48 |
|
| 49 |
clean: |
| 50 |
-rm -f idle3ctl $(OBJS) core 2>/dev/null |
| 51 |
|