28 lines
388 B
Makefile
28 lines
388 B
Makefile
|
include Makefile.o.dep
|
||
|
|
||
|
libname=date.a
|
||
|
|
||
|
all: $(libname)
|
||
|
|
||
|
$(libname): $(o)
|
||
|
ar rcs $(libname) $(o)
|
||
|
|
||
|
|
||
|
%.o: %.cpp
|
||
|
$(CXX) -c $(CXXFLAGS) $<
|
||
|
|
||
|
|
||
|
|
||
|
depend:
|
||
|
makedepend -Y. -I.. -f- *.cpp > Makefile.dep
|
||
|
echo -n "o = " > Makefile.o.dep
|
||
|
ls -1 *.cpp | xargs -I foo echo -n foo " " | sed -E "s/([^\.]*)\.cpp[ ]/\1\.o/g" >> Makefile.o.dep
|
||
|
|
||
|
|
||
|
clean:
|
||
|
rm -f *.o
|
||
|
rm -f $(libname)
|
||
|
|
||
|
|
||
|
include Makefile.dep
|