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
|
|
|
|
|
1998-05-20 19:54:33 +08:00
|
|
|
.PHONY: all this dep
|
|
|
|
|
|
|
|
all:
|
|
|
|
@echo "Please run the top-level Makefile instead."
|
|
|
|
@exit 1
|
|
|
|
|
1998-05-15 15:56:13 +08:00
|
|
|
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-20 19:54:33 +08:00
|
|
|
this: $(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
|
|
|
|
|
1998-05-20 19:54:33 +08:00
|
|
|
this: $(ONAME)
|
1998-05-15 15:56:13 +08:00
|
|
|
|
|
|
|
$(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
|