refactoring
[rrq/rrqmisc.git] / vector / Makefile
1 LIBRARY = libvector.a
2 LIBOBJS = Vector.o HashVector.o
3 LIBOBJS += Tuple.o TupleSchema.o integeritem.o stringitem.o Binding.o
4 LIBOBJS += BindingTable.o Relation.o Query.o
5 LIBOBJS += AssignQuery.o RelationQuery.o
6 LIBOBJS += NotQuery.o AndQuery.o OrQuery.o
7 #LIBOBJS += View.o
8
9 default: $(LIBRARY)
10
11 all: default
12
13 CFLAGS = -Wall -g -fmax-errors=1 -I.
14 LDLIBS = -lm
15
16 %.h:
17         echo "#ifndef ${@:.h=_H}" > $@
18         echo "#define ${@:.h=_H}" >> $@
19         echo "#endif" >> $@
20
21 define STDCC
22 .INTERMEDIATE: $1.o
23 CLEANRM += $1.o
24 $1.o: $1.c | $1.h
25 endef
26
27 $(foreach OBJ,$(LIBOBJS:.o=),$(eval $(call STDCC,$(OBJ))))
28
29 CLEANRM += $(LIBRARY)
30 $(LIBRARY): $(LIBOBJS)
31         $(AR) r $@ $^
32
33 clean:
34         rm -f $(CLEANRM)