Makefile 717 B

1234567891011121314151617181920212223242526272829303132
  1. # Build C++ client example
  2. # Process with GNU make
  3. all: test
  4. check: all
  5. ./test
  6. HEADER := ../include/mp4parse.h
  7. CXXFLAGS = -g -Wall -std=c++11 -I$(dir $(HEADER))
  8. CRATE_DIR := ../target/debug/deps
  9. libmp4parse.a libmp4parse.a.out : ../src/lib.rs
  10. rustc -g --crate-type staticlib --crate-name mp4parse \
  11. --emit dep-info,link=$@ \
  12. -L $(CRATE_DIR) $< \
  13. 2> libmp4parse.a.out || cat libmp4parse.a.out >&2
  14. -include mp4parse.d
  15. test: RUST_LIBS = $(shell awk '/^note: library: / {print "-l"$$3}' libmp4parse.a.out)
  16. test: test.cc libmp4parse.a $(HEADER)
  17. $(CXX) $(CXXFLAGS) -c $(filter %.cc,$^)
  18. $(CXX) $(CXXFLAGS) -o $@ *.o libmp4parse.a $(RUST_LIBS)
  19. clean:
  20. $(RM) test
  21. $(RM) *.a.out
  22. $(RM) *.o *.a
  23. $(RM) *.d