|
@@ -15,10 +15,13 @@ USRSCTP_CFLAGS:=-fPIC -Wno-address-of-packed-member
|
|
SRCS=$(shell printf "%s " src/*.cpp)
|
|
SRCS=$(shell printf "%s " src/*.cpp)
|
|
OBJS=$(subst .cpp,.o,$(SRCS))
|
|
OBJS=$(subst .cpp,.o,$(SRCS))
|
|
|
|
|
|
-all: $(NAME).a $(NAME).so
|
|
|
|
|
|
+all: $(NAME).a $(NAME).so tests
|
|
|
|
|
|
-%.o: %.cpp
|
|
|
|
- $(CXX) $(INCLUDES) $(CPPFLAGS) $(USRSCTP_DEFINES) -MMD -MP -o $@ -c $<
|
|
|
|
|
|
+src/%.o: src/%.cpp
|
|
|
|
+ $(CXX) $(CPPFLAGS) $(INCLUDES) $(USRSCTP_DEFINES) -MMD -MP -o $@ -c $<
|
|
|
|
+
|
|
|
|
+test/%.o: test/%.cpp
|
|
|
|
+ $(CXX) $(CPPFLAGS) -Isrc -MMD -MP -o $@ -c $<
|
|
|
|
|
|
-include $(subst .o,.d,$(OBJS))
|
|
-include $(subst .o,.d,$(OBJS))
|
|
|
|
|
|
@@ -26,7 +29,10 @@ $(NAME).a: $(OBJS)
|
|
$(AR) crf $@ $(OBJS)
|
|
$(AR) crf $@ $(OBJS)
|
|
|
|
|
|
$(NAME).so: libusrsctp.a $(OBJS)
|
|
$(NAME).so: libusrsctp.a $(OBJS)
|
|
- $(CXX) $(LDFLAGS) -o $@ $(OBJS) $(LDLIBS) -shared libusrsctp.a
|
|
|
|
|
|
+ $(CXX) $(LDFLAGS) -shared -o $@ $(OBJS) $(LDLIBS) libusrsctp.a
|
|
|
|
+
|
|
|
|
+tests: $(NAME).a test/main.o
|
|
|
|
+ $(CXX) $(LDFLAGS) -o $@ test/main.o $(LDLIBS) $(NAME).a libusrsctp.a
|
|
|
|
|
|
clean:
|
|
clean:
|
|
$(RM) src/*.o src/*.d
|
|
$(RM) src/*.o src/*.d
|
|
@@ -40,3 +46,4 @@ dist-clean: clean
|
|
libusrsctp.a:
|
|
libusrsctp.a:
|
|
cd $(USRSCTP_DIR) && ./bootstrap && CFLAGS="$(USRSCTP_CFLAGS)" ./configure --enable-static && make
|
|
cd $(USRSCTP_DIR) && ./bootstrap && CFLAGS="$(USRSCTP_CFLAGS)" ./configure --enable-static && make
|
|
cp $(USRSCTP_DIR)/usrsctplib/.libs/libusrsctp.a .
|
|
cp $(USRSCTP_DIR)/usrsctplib/.libs/libusrsctp.a .
|
|
|
|
+
|