1998-04-22 20:58:34 +08:00
|
|
|
# Makefile for the BIRD Internet Routing Daemon
|
|
|
|
# (c) 1998 Martin Mares <mj@ucw.cz>
|
|
|
|
|
|
|
|
THISDIR=$(shell pwd)
|
|
|
|
RELDIR=$(subst $(TOPDIR)/,,$(THISDIR))
|
1998-05-15 15:56:13 +08:00
|
|
|
ONAME=$(subst /,_,$(RELDIR)).o
|
|
|
|
|
|
|
|
ifndef SRCS
|
1998-04-28 22:39:34 +08:00
|
|
|
SRCS=$(subst .o,.c,$(OBJS))
|
1998-05-15 15:56:13 +08:00
|
|
|
endif
|
|
|
|
|
|
|
|
ifdef OBJS
|
1998-04-22 20:58:34 +08:00
|
|
|
|
1998-05-15 15:56:13 +08:00
|
|
|
ifdef LIB
|
1998-04-22 20:58:34 +08:00
|
|
|
|
1998-05-15 15:56:13 +08:00
|
|
|
all: $(LIB)
|
1998-04-28 22:39:34 +08:00
|
|
|
|
1998-05-15 15:56:13 +08:00
|
|
|
$(LIB): $(OBJS)
|
|
|
|
rm -f $(LIB)
|
|
|
|
ar rcs $(LIB) $(OBJS)
|
|
|
|
ranlib $(LIB)
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
all: $(ONAME)
|
|
|
|
|
|
|
|
$(ONAME): $(OBJS)
|
|
|
|
$(LD) -r -o $(ONAME) $(OBJS)
|
|
|
|
|
|
|
|
endif
|
1998-04-28 22:39:34 +08:00
|
|
|
|
|
|
|
dep: $(SRCS)
|
|
|
|
rm -f .depend
|
|
|
|
for a in $(SRCS) ; do gcc $(CPPFLAGS) -MM $$a >>.depend ; done
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
dep:
|
|
|
|
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifneq ($(wildcard .depend),)
|
|
|
|
include .depend
|
|
|
|
endif
|