-TARGET=btree
+TARGETS=btree libbtree.a
CXXFLAGS=-Wall -g
-all: $(TARGET)
+BTREE_COMMON=btree.o clave_fija.o btree_data.o
-$(TARGET): main.o btree.o clave_fija.o
- g++ -o $(TARGET) main.o btree.o clave_fija.o
+all: $(TARGETS)
+
+btree: main.o $(BTREE_COMMON)
+ g++ -o btree main.o $(BTREE_COMMON)
+
+libbtree.a: $(BTREE_COMMON)
+ $(AR) cru libbtree.a $(BTREE_COMMON)
clean:
- rm -rf *.o $(TARGET)
+ rm -rf *.o $(TARGETS)