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 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86
|
# Operator Shell (OSH) Makefile
# Mike Neuman
# mcn@EnGarde.com
#
SHELL = /bin/sh
@SET_MAKE@
.SUFFIXES:
.SUFFIXES: .c .o
SRCS = exp.c handlers.c main.c
OBJS = exp.o handlers.o main.o
CC = @CC@ @DEFS@
CFLAGS = -I. -Wall
LDFLAGS = @LDFLAGS@
LIBS = @LIBS@
### Debian-only hack
INSTALL = install
INSTALL_FILE = $(INSTALL) -p -o root -g root -m 644
INSTALL_PROGRAM = $(INSTALL) -p -o root -g root -m 755
INSTALL_SCRIPT = $(INSTALL) -p -o root -g root -m 755
INSTALL_DIR = $(INSTALL) -p -d -o root -g root -m 755
DESTDIR =
### "debug" support
ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS)))
# compile with debugging information and don't optimize
CFLAGS += -g
else
# compile without debugging information and do optimize
CFLAGS += -O2
endif
### "nostrip" support
ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
INSTALL_PROGRAM += -s
endif
### end of Debian-only hack
all: osh consult
(cd rvi;$(MAKE))
install: osh consult
echo "Do the installation by hand. Read INSTALL"
main.o: struct.h config.h
exp.o: struct.h config.h
handlers.o: struct.h config.h
osadmin.o: struct.h config.h
consult.o: config.h
osh: $(OBJS)
$(CC) $(CFLAGS) -o osh $(OBJS) $(LIBS)
osadmin:
$(CC) -g $(CFLAGS) -o osadmin osadmin.c $(LIBS)
consult:
$(CC) $(CFLAGS) -o consult consult.c
clean:
rm -f $(OBJS) $(AOBJS) osh.tar.Z
# Distribution and Development stuff
allclean:
rm -f $(OBJS) $(AOBJS) osh.tar.Z osh.tar.gz osh consult config.cache \
config.log config.status defs.h Makefile
(cd rvi;make clean)
rm -f rvi/Makefile
osh.tar.Z: allclean
(cd ..;tar cf osh.tar osh;compress osh.tar;mv osh.tar.Z osh)
osh.tar.gz: allclean
(cd ..;tar cf osh.tar osh;gzip --best osh.tar;mv osh.tar.gz osh)
### Debian-only hack
install-osh: osh
$(INSTALL_DIR) $(DESTDIR)/usr/sbin/
$(INSTALL_DIR) $(DESTDIR)/etc/
$(INSTALL_PROGRAM) osh $(DESTDIR)/usr/sbin/osh
$(INSTALL_FILE) table $(DESTDIR)/etc/osh.conf
### end of Debian-only hack
|