CXX = g++
CXXFLAGS = -Wall -Wextra -std=c++11

LIB = libtest.a
OBJS = ctest1.o ctest2.o
TARGET = prog_static

all: $(LIB) $(TARGET)

$(LIB): $(OBJS)
	ar rcs $(LIB) $(OBJS)

ctest1.o: ctest1.cpp
	$(CXX) $(CXXFLAGS) -c ctest1.cpp

ctest2.o: ctest2.cpp
	$(CXX) $(CXXFLAGS) -c ctest2.cpp

$(TARGET): prog.cpp $(LIB)
	$(CXX) $(CXXFLAGS) prog.cpp -L. -ltest -o $(TARGET)

clean:
	rm -f *.o *.a $(TARGET)


