2012-11-14 11:35:21 +00:00
|
|
|
DEFINES=
|
2014-05-01 16:21:08 +00:00
|
|
|
CC?=gcc
|
|
|
|
CXX?=g++
|
|
|
|
LD?=g++
|
2013-06-12 23:50:14 +00:00
|
|
|
CFLAGS=-g -std=c99 -Wall $(DEFINES) -Ilib
|
|
|
|
CXXFLAGS=-g -Wall $(DEFINES) -Ilib
|
|
|
|
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)
|