2021-03-17 13:16:01 +01:00
|
|
|
sourcefiles:=$(shell find . -name "*.cpp")
|
|
|
|
objfiles:=$(patsubst %.cpp,%.o,$(sourcefiles))
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-01-12 03:46:16 +01:00
|
|
|
ifndef CXX
|
2021-05-10 20:07:08 +02:00
|
|
|
CXX = g++
|
2012-01-12 03:46:16 +01:00
|
|
|
endif
|
|
|
|
|
|
|
|
ifndef CXXFLAGS
|
2021-05-10 20:07:08 +02:00
|
|
|
CXXFLAGS = -Wall -pedantic -O2 -std=c++20 -I../src -I/usr/local/include
|
2012-07-01 01:22:31 +02:00
|
|
|
endif
|
|
|
|
|
2014-11-12 05:11:28 +01:00
|
|
|
ifndef AR
|
|
|
|
AR = ar
|
|
|
|
endif
|
|
|
|
|
2012-01-12 03:46:16 +01:00
|
|
|
|
2012-05-05 17:08:04 +02:00
|
|
|
|
|
|
|
|
2021-03-17 13:16:01 +01:00
|
|
|
libname = pikotools.a
|
2012-05-05 17:08:04 +02:00
|
|
|
|
2012-01-12 03:46:16 +01:00
|
|
|
|
2021-03-17 13:16:01 +01:00
|
|
|
all: $(libname)
|
2012-01-12 03:46:16 +01:00
|
|
|
|
|
|
|
|
2021-03-17 13:16:01 +01:00
|
|
|
$(libname): $(objfiles)
|
|
|
|
$(AR) rcs $(libname) $(objfiles)
|
2016-01-21 19:49:42 +01:00
|
|
|
|
2012-01-12 03:46:16 +01:00
|
|
|
|
2021-03-17 13:16:01 +01:00
|
|
|
%.o: %.cpp
|
|
|
|
$(CXX) -c $(CXXFLAGS) -o $@ $<
|
2012-05-05 17:08:04 +02:00
|
|
|
|
|
|
|
|
2021-03-17 13:16:01 +01:00
|
|
|
clean:
|
|
|
|
rm -f $(objfiles)
|
|
|
|
rm -f $(libname)
|
2012-05-05 17:08:04 +02:00
|
|
|
|
2012-01-12 03:46:16 +01:00
|
|
|
|
2021-03-17 13:16:01 +01:00
|
|
|
depend:
|
|
|
|
makedepend -Y. -f- $(sourcefiles) > Makefile.dep
|
2012-01-12 03:46:16 +01:00
|
|
|
|
|
|
|
|
2021-03-17 13:16:01 +01:00
|
|
|
-include Makefile.dep
|
2012-01-12 03:46:16 +01:00
|
|
|
|