Statistics
| Branch: | Revision:

grapes / src / Makefile.oot @ 6a4988a7

History | View | Annotate | Download (852 Bytes)

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

    
4
SUBDIRS = ChunkIDSet ChunkTrading TopologyManager ChunkBuffer PeerSet Scheduler Cache PeerSampler CloudSupport Utils
5
ifneq ($(ARCH),win32)
6
  SUBDIRS += Chunkiser
7
endif
8
COMMON_OBJS = config.o
9

    
10
.PHONY: subdirs $(SUBDIRS)
11

    
12
OBJ_LSTS = $(addsuffix /objs.lst, $(SUBDIRS))
13

    
14
all: libgrapes.a
15

    
16
$(SUBDIRS):
17
	mkdir -p $@
18

    
19
Tests:
20
	mkdir Tests
21

    
22
$(OBJ_LSTS): $(SUBDIRS)
23
tests: Tests
24

    
25
$(OBJ_LSTS):
26
	$(MAKE) -C $(dir $@) -f $(BASE)/src/$(dir $@)/Makefile BASE=$(BASE) CFGDIR=$(CFGDIR) objs.lst
27

    
28
libgrapes.a: $(OBJ_LSTS) $(COMMON_OBJS)
29
	$(AR) rcs libgrapes.a `cat $(OBJ_LSTS)` $(COMMON_OBJS)
30
	rm */*.lst
31

    
32
tests: libgrapes.a
33
	$(MAKE) -C Tests -f $(BASE)/src/Tests/Makefile BASE=$(BASE) CFGDIR=$(CFGDIR)
34

    
35
clean:
36
	rm -f */*.a
37
	rm -f */*.o
38
	rm -f */*.lst
39
	rm -f */*.d
40

    
41
allclean:
42
	rm -rf $(SUBDIRS) Tests
43
	rm -f *.o *.a
44
	rm -f *.d