Makefile 620 Bytes
Newer Older
Gabriel Margiani's avatar
Gabriel Margiani committed
1 2
CXX = g++

Gabriel Margiani's avatar
Gabriel Margiani committed
3
CXXFLAGS = -Wall -g -std=c++14 -MD -fPIC $(shell pkg-config --cflags libpjproject)
Gabriel Margiani's avatar
Gabriel Margiani committed
4

Gabriel Margiani's avatar
Gabriel Margiani committed
5
LIBS = -lrt $(shell pkg-config --libs libpjproject)
Gabriel Margiani's avatar
Gabriel Margiani committed
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34

SRCS = $(wildcard src/*.cpp)

OBJS = $(SRCS:.cpp=.o)

MAIN = 3phone

.PHONY: depend clean

all: $(MAIN)
	@echo "3phone build."

$(MAIN): $(OBJS) 
	@echo Linking...
	@$(CXX) $(CXXFLAGS) -o $(MAIN) $(OBJS) $(LIBS)

%.o : %.cpp
	@echo "$< --> $@"
	@$(CXX) $(CXXFLAGS) -c $<  -o $@
	@cp $*.d $*.P; \
		sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' \
			-e '/^$$/ d' -e 's/$$/ :/' < $*.d >> $*.P; \
		rm -f "$*.d"

clean:
	@rm src/*.o  $(MAIN)


-include $(SRCS:.cpp=.P)