Makefile.sample 1.3 KB

1234567891011121314151617181920212223242526272829303132333435
  1. #-------------------------------------------------------------------------------------------------------
  2. # Copyright (C) Microsoft. All rights reserved.
  3. # Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
  4. #-------------------------------------------------------------------------------------------------------
  5. IDIR=../include
  6. CC=g++
  7. ifeq (darwin, ${PLATFORM})
  8. LDIR=../lib/libChakraCore.dylib
  9. ICU4C_LIBRARY_PATH ?= /usr/local/opt/icu4c
  10. CFLAGS=-lstdc++ -std=c++11 -I$(IDIR)
  11. FORCE_STARTS=-Wl,-force_load,
  12. FORCE_ENDS=
  13. LIBS=-framework CoreFoundation -framework Security -lm -ldl -Wno-c++11-compat-deprecated-writable-strings \
  14. -Wno-deprecated-declarations -Wno-unknown-warning-option -o sample.o
  15. LDIR+=$(ICU4C_LIBRARY_PATH)/lib/libicudata.a \
  16. $(ICU4C_LIBRARY_PATH)/lib/libicuuc.a \
  17. $(ICU4C_LIBRARY_PATH)/lib/libicui18n.a
  18. else
  19. LDIR=../lib/libChakraCore.so
  20. CFLAGS=-lstdc++ -std=c++0x -I$(IDIR)
  21. FORCE_STARTS=-Wl,--whole-archive
  22. FORCE_ENDS=-Wl,--no-whole-archive
  23. LIBS=-pthread -lm -ldl -licuuc -Wno-c++11-compat-deprecated-writable-strings \
  24. -Wno-deprecated-declarations -Wno-unknown-warning-option -o sample.o
  25. endif
  26. testmake:
  27. $(CC) sample.cpp $(CFLAGS) $(FORCE_STARTS) $(LDIR) $(FORCE_ENDS) $(LIBS)
  28. .PHONY: clean
  29. clean:
  30. rm sample.o