aboutsummaryrefslogtreecommitdiffstats
path: root/libdash/source/sublibs.mk
blob: 69173c3b80465846f7e15dd1402382c201b0adbd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
LIBDIR=../libs
OBJECTS=$(SOURCES:.cpp=.o)
DIRNAME=$(shell basename $(shell pwd))
LIBRARY=$(LIBDIR)/lib$(DIRNAME).a

all: $(SOURCES) $(LIBRARY)

$(LIBRARY): $(OBJECTS)
	mkdir -p $(LIBDIR) 
	rm -f $@
	$(AR) $(ARFLAGS) $@ $(OBJECTS)

.cpp.o:
	$(CC) $(CFLAGS) $< -o $@

clean:
	rm -f $(OBJECTS)

distclean: clean
	rm -f $(LIBRARY)
	if test -d $(LIBDIR); then \
		rmdir --ignore-fail-on-non-empty $(LIBDIR) ; \
	fi