Makefile 623 B

1234567891011121314151617181920212223242526
  1. # Build C++ client example
  2. # Process with GNU make
  3. all: test
  4. check: all
  5. ./test
  6. CXXFLAGS = -g -Wall -std=c++1y -I../include
  7. RUST_LIBS = -ldl -lpthread -lrt -lgcc_s -lpthread -lc -lm
  8. RUST_SRCS := ../src/lib.rs
  9. libmp4parse.a libmp4parse.a.out : $(RUST_SRCS)
  10. rustc -g --crate-type staticlib -o libmp4parse.a -L ../target/debug/deps/ $^ 2> libmp4parse.a.out
  11. test: RUST_LIBS = $(shell awk '/^note: library: / {print "-l"$$3}' libmp4parse.a.out)
  12. test: dump.cc libmp4parse.a
  13. $(CXX) $(CXXFLAGS) -c $(filter %.cc,$^)
  14. $(CXX) $(CXXFLAGS) -o $@ *.o libmp4parse.a $(RUST_LIBS)
  15. clean:
  16. $(RM) test
  17. $(RM) *.a.out
  18. $(RM) *.o *.a