Revision 25697773 Rules

View differences:

Rules
3 3

  
4 4
THISDIR=$(shell pwd)
5 5
RELDIR=$(subst $(TOPDIR)/,,$(THISDIR))
6
ANAME=$(subst /,_,$(RELDIR)).a
6
ONAME=$(subst /,_,$(RELDIR)).o
7

  
8
ifndef SRCS
7 9
SRCS=$(subst .o,.c,$(OBJS))
10
endif
11

  
12
ifdef OBJS
8 13

  
9
all: $(ANAME)
14
ifdef LIB
10 15

  
11
$(ANAME): $(OBJS)
12
	rm -f $(ANAME)
13
	ar rcs $(ANAME) $(OBJS)
16
all: $(LIB)
14 17

  
15
ifdef OBJS
18
$(LIB): $(OBJS)
19
	rm -f $(LIB)
20
	ar rcs $(LIB) $(OBJS)
21
	ranlib $(LIB)
22

  
23
else
24

  
25
all: $(ONAME)
26

  
27
$(ONAME): $(OBJS)
28
	$(LD) -r -o $(ONAME) $(OBJS)
29

  
30
endif
16 31

  
17 32
dep: $(SRCS)
18 33
	rm -f .depend

Also available in: Unified diff