Makefile 699 B

123456789101112131415161718192021222324252627
  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. HEADER := ../include/mp4parse.h
  9. RUST_SRCS := ../src/lib.rs $(wildcard ../src/*.rs)
  10. libmp4parse.a libmp4parse.a.out : $(RUST_SRCS) $(HEADER)
  11. rustc -g --crate-type staticlib -o libmp4parse.a -L ../target/debug/deps/ $< 2> libmp4parse.a.out
  12. test: RUST_LIBS = $(shell awk '/^note: library: / {print "-l"$$3}' libmp4parse.a.out)
  13. test: dump.cc libmp4parse.a $(HEADER)
  14. $(CXX) $(CXXFLAGS) -c $(filter %.cc,$^)
  15. $(CXX) $(CXXFLAGS) -o $@ *.o libmp4parse.a $(RUST_LIBS)
  16. clean:
  17. $(RM) test
  18. $(RM) *.a.out
  19. $(RM) *.o *.a