#   -*-Makefile-*- template for cipelib
#
#   Copyright 2000 Olaf Titz <olaf@bigred.inka.de>
#
#   This program is free software; you can redistribute it and/or
#   modify it under the terms of the GNU General Public License
#   as published by the Free Software Foundation; either version
#   2 of the License, or (at your option) any later version.

# $Id: Makefile.in,v 1.9 2000/12/30 23:02:08 olaf Exp $

WARN	:= -Wmissing-prototypes
CC	:= @CC@
CFLAGS	:= @CFLAGS@ $(WARN)
CPPFLAGS:= @CPPFLAGS@
DEFS	:= @DEFS@ -DLIBRARY $(EXTRADEFS)

all: libcipe.a

OBJS := cipe_syslog.o debug.o dsprintf.o \
	getaddr.o gethex.o hex.o hexdump.o hexstr.o parseopt.o \
	retstatus.o setsig.o secchk.o sighand.o \
	socks_errlist.o socks5_open.o socks5_cmd.o \
	xread.o xwrite.o xwritev.o
SRCS:=$(OBJS:.o=.c) cipelib.h Makefile.in

libcipe.a: $(OBJS)
	ar rcs $@ $(OBJS)

install:
	: Nothing to install here

clean:
	rm -f *.[oaisd] *.out core

realclean distclean: clean
	rm -f *.tmp .tmp Makefile

%.o: %.c
	$(CC) $(CPPFLAGS) $(CFLAGS) $(DEFS) $(CFLAGS_$*) -MD -c $<

%.i: %.c
	$(CC) $(CPPFLAGS) $(CFLAGS) $(DEFS) $(CFLAGS_$*) -E -dD $< >$@

%.s: %.c
	$(CC) $(CPPFLAGS) $(CFLAGS) $(DEFS) $(CFLAGS_$*) -fverbose-asm \
		-o $@ -S $<

.PHONY: all clean realclean distclean

%.d: %.o

.SECONDARY: %.d

DEPS:=$(patsubst %.o,%.d,$(OBJS))

ifeq (,$(findstring n,$(MAKEFLAGS)))
ifeq (,$(filter clean dep% %.i %.s,$(MAKECMDGOALS)))
-include $(DEPS)
endif
endif

