2012-11-14 11:35:21 +00:00
|
|
|
DEFINES=
|
2014-05-01 16:21:08 +00:00
|
|
|
CC?=gcc
|
|
|
|
CXX?=g++
|
|
|
|
LD?=g++
|
2014-12-14 10:53:55 +00:00
|
|
|
INCLUDE=-Iinclude/
|
|
|
|
CFLAGS=-g -std=c99 -Wall $(DEFINES) $(INCLUDE)
|
2017-01-26 14:26:10 +00:00
|
|
|
CXXFLAGS=-g -std=c++11 -Wall $(DEFINES) $(INCLUDE)
|
2013-06-12 23:50:14 +00:00
|
|
|
LDFLAGS=-Llib -lsocdesc `xml2-config --libs`
|
|
|
|
SRC=$(wildcard *.c)
|
|
|
|
SRCXX=$(wildcard *.cpp)
|
|
|
|
EXEC=$(SRC:.c=) $(SRCXX:.cpp=)
|
|
|
|
LIB=lib/libsocdesc.a
|
2012-11-14 11:35:21 +00:00
|
|
|
|
2013-06-12 23:50:14 +00:00
|
|
|
all: $(EXEC)
|
2012-11-14 11:35:21 +00:00
|
|
|
|
2013-06-12 23:50:14 +00:00
|
|
|
$(LIB):
|
|
|
|
make -C lib
|
2012-11-14 11:35:21 +00:00
|
|
|
|
2013-06-12 23:50:14 +00:00
|
|
|
%: %.c $(LIB)
|
|
|
|
$(CC) $(CFLAGS) -o $@ $< $(LDFLAGS)
|
2012-11-14 11:35:21 +00:00
|
|
|
|
2013-06-12 23:50:14 +00:00
|
|
|
%: %.cpp $(LIB)
|
|
|
|
$(CXX) $(CXXFLAGS) -o $@ $< $(LDFLAGS)
|
2012-11-14 11:35:21 +00:00
|
|
|
|
|
|
|
clean:
|
2013-06-12 23:50:14 +00:00
|
|
|
rm -fr $(EXEC)
|