summaryrefslogtreecommitdiffstats
path: root/Rules
blob: 2d9c0a8a4a7fe7f1f5bd4879ca21b7e78a7d70e9 (plain)
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
# Makefile for the BIRD Internet Routing Daemon
# (c) 1998 Martin Mares <mj@ucw.cz>

THISDIR=$(shell pwd)
RELDIR=$(subst $(TOPDIR)/,,$(THISDIR))
ONAME=$(subst /,_,$(RELDIR)).o

ifndef SRCS
SRCS=$(subst .o,.c,$(OBJS))
endif

ifdef OBJS

ifdef LIB

all: $(LIB)

$(LIB): $(OBJS)
	rm -f $(LIB)
	ar rcs $(LIB) $(OBJS)
	ranlib $(LIB)

else

all: $(ONAME)

$(ONAME): $(OBJS)
	$(LD) -r -o $(ONAME) $(OBJS)

endif

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