Skip to content

Commit

Permalink
Cleaned up Makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
paullouisageneau committed Aug 26, 2019
1 parent d2a3084 commit 8d64b1b
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,16 @@ LDLIBS=$(shell pkg-config --libs glib-2.0 gobject-2.0 nice) -lgnutls
INCLUDES=$(shell pkg-config --cflags glib-2.0 gobject-2.0 nice) -I$(USRSCTP_DIR)/usrsctplib

USRSCTP_DIR:=usrsctp
USRSCTP_FLAGS:=-DINET -DINET6
USRSCTP_DEFINES:=-DINET -DINET6
USRSCTP_CFLAGS:=-fPIC -Wno-address-of-packed-member

SRCS=$(shell printf "%s " src/*.cpp)
OBJS=$(subst .cpp,.o,$(SRCS))

all: $(NAME).a $(NAME).so

%.o: %.cpp
$(CXX) $(INCLUDES) $(CPPFLAGS) $(USRSCTP_FLAGS) -I. -MMD -MP -o $@ -c $<
$(CXX) $(INCLUDES) $(CPPFLAGS) $(USRSCTP_DEFINES) -MMD -MP -o $@ -c $<

-include $(subst .o,.d,$(OBJS))

Expand All @@ -37,5 +38,5 @@ dist-clean: clean
$(RM) src/*~

libusrsctp.a:
cd $(USRSCTP_DIR) && ./bootstrap && CFLAGS="-fPIC -Wno-address-of-packed-member" ./configure --enable-static && make
cd $(USRSCTP_DIR) && ./bootstrap && CFLAGS="$(USRSCTP_CFLAGS)" ./configure --enable-static && make
cp $(USRSCTP_DIR)/usrsctplib/.libs/libusrsctp.a .

0 comments on commit 8d64b1b

Please sign in to comment.