Statistics
| Branch: | Revision:

grapes / src / Makefile.oot @ 4c5ab49d

History | View | Annotate | Download (782 Bytes)

1
CFGDIR ?= $(CURDIR)
2
vpath %.c $(BASE)/src
3

    
4
SUBDIRS = ChunkIDSet ChunkTrading TopologyManager ChunkBuffer PeerSet Scheduler Cache PeerSampler
5
COMMON_OBJS = config.o
6

    
7
.PHONY: subdirs $(SUBDIRS)
8

    
9
OBJ_LSTS = $(addsuffix /objs.lst, $(SUBDIRS))
10

    
11
all: libgrapes.a
12

    
13
$(SUBDIRS):
14
	mkdir -p $@
15

    
16
Tests:
17
	mkdir Tests
18

    
19
$(OBJ_LSTS): $(SUBDIRS)
20
tests: Tests
21

    
22
$(OBJ_LSTS):
23
	$(MAKE) -C $(dir $@) -f $(BASE)/src/$(dir $@)/Makefile BASE=$(BASE) CFGDIR=$(CFGDIR) objs.lst
24

    
25
libgrapes.a: $(OBJ_LSTS) $(COMMON_OBJS)
26
	$(AR) rcs libgrapes.a `cat $(OBJ_LSTS)` $(COMMON_OBJS)
27
	rm */*.lst
28

    
29
tests: libgrapes.a
30
	$(MAKE) -C Tests -f $(BASE)/src/Tests/Makefile BASE=$(BASE) CFGDIR=$(CFGDIR)
31

    
32
clean:
33
	rm -f */*.a
34
	rm -f */*.o
35
	rm -f */*.lst
36
	rm -f */*.d
37

    
38
allclean:
39
	rm -rf $(SUBDIRS) Tests
40
	rm -f *.o *.a
41
	rm -f *.d