Skip to content
Snippets Groups Projects
Commit be32ee43 authored by Per Cederqvist's avatar Per Cederqvist
Browse files

Remember the last OS that the utilities was built for. Added 'install' target.

parent 8e751e85
No related branches found
No related tags found
No related merge requests found
# Makefile for lyskom Nagios utilities # Makefile for lyskom Nagios utilities
LIBEXECDIR=/usr/local/nagios/libexec/
PROGS=notify_lyskom check_lyskom
COBJS=lyskom.o buffer.o COBJS=lyskom.o buffer.o
CFLAGS=-g -O CFLAGS=-g -O
boo: boo:
@echo "Enter 'make linux' or 'make solaris'" @if [ -f .lastos ]; then $(MAKE) `cat .lastos`||exit 1; \
else echo "Enter 'make linux' or 'make solaris'" ; fi
linux: linux:
echo linux > .lastos
$(MAKE) LIBS="-lrt" CC="$(CC)" CFLAGS="$(CFLAGS)" all $(MAKE) LIBS="-lrt" CC="$(CC)" CFLAGS="$(CFLAGS)" all
solaris: solaris:
echo solaris > .lastos
$(MAKE) LIBS="-lrt -lnsl -lsocket" CC="$(CC)" CFLAGS="$(CFLAGS)" all $(MAKE) LIBS="-lrt -lnsl -lsocket" CC="$(CC)" CFLAGS="$(CFLAGS)" all
all: notify_lyskom check_lyskom all: $(PROGS)
notify_lyskom: notify_lyskom.o $(COBJS) notify_lyskom: notify_lyskom.o $(COBJS)
$(CC) -o notify_lyskom notify_lyskom.o $(COBJS) $(LIBS) $(CC) -o notify_lyskom notify_lyskom.o $(COBJS) $(LIBS)
...@@ -24,3 +29,8 @@ check_lyskom: check_lyskom.o $(COBJS) ...@@ -24,3 +29,8 @@ check_lyskom: check_lyskom.o $(COBJS)
distclean clean: distclean clean:
-rm -f core notify_lyskom check_lyskom *.o *~ \#* -rm -f core notify_lyskom check_lyskom *.o *~ \#*
install:
$(MAKE) boo
for i in $(PROGS); \
do install $$i $(DESTDIR)$(LIBEXECDIR)/$$i || exit 1; done
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment