Makefile 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. # Copyright 2015 Google Inc. All Rights Reserved.
  2. #
  3. # Licensed under the Apache License, Version 2.0 (the "License");
  4. # you may not use this file except in compliance with the License.
  5. # You may obtain a copy of the License at
  6. #
  7. # http://www.apache.org/licenses/LICENSE-2.0
  8. #
  9. # Unless required by applicable law or agreed to in writing, software
  10. # distributed under the License is distributed on an "AS IS" BASIS,
  11. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. # See the License for the specific language governing permissions and
  13. # limitations under the License.
  14. all: v2
  15. v2:
  16. PYTHONPATH=$(PYTHONPATH):$(CURDIR)/scripts/lib python scripts/build-v2.py
  17. masters-%:
  18. PYTHONPATH=$(PYTHONPATH):$(CURDIR)/scripts/lib python scripts/build_masters.py $@
  19. crunch:
  20. mkdir -p out/crunched
  21. cd third_party/fontcrunch && \
  22. for source in ../../out/RobotoTTF/*.ttf ../../out/RobotoCondensedTTF/*.ttf; do \
  23. python fontcrunch.py gen $$source; \
  24. done && \
  25. $(MAKE) -j8 && \
  26. for source in ../../out/RobotoTTF/*.ttf ../../out/RobotoCondensedTTF/*.ttf; do \
  27. python fontcrunch.py pack $$source ../../out/crunched/$$(basename $$source) >/dev/null; \
  28. done
  29. android:
  30. mkdir -p out/android
  31. for source in out/crunched/*.ttf; do \
  32. touched=$$(mktemp); \
  33. subsetted=$$(mktemp); \
  34. final=out/android/$$(basename $$source); \
  35. python scripts/touchup_for_android.py $$source $$touched && \
  36. python $$HOME/noto/nototools/subset.py $$touched $$subsetted && \
  37. python scripts/force_yminmax.py $$subsetted $$final && \
  38. rm $$touched $$subsetted; \
  39. done
  40. # TODO: remove this build target once we are comfortable with the quality of
  41. # the new toolchain
  42. android-from-hinted:
  43. mkdir -p out/android
  44. for source in hinted/*.ttf; do \
  45. unhinted=$$(mktemp); \
  46. touched=$$(mktemp); \
  47. subsetted=$$(mktemp); \
  48. final=out/android/$$(basename $$source); \
  49. python $$HOME/noto/nototools/drop_hints.py $$source $$unhinted && \
  50. python scripts/touchup_for_android.py $$unhinted $$touched && \
  51. python $$HOME/noto/nototools/subset.py $$touched $$subsetted && \
  52. python scripts/force_yminmax.py $$subsetted $$final && \
  53. rm $$touched $$subsetted; \
  54. done
  55. web:
  56. mkdir -p out/web
  57. for source in hinted/*.ttf; do \
  58. basename=$$(basename $$source); \
  59. case $$source in \
  60. hinted/Roboto-*) unhinted=out/RobotoTTF/$$basename ;; \
  61. *) unhinted=out/RobotoCondensedTTF/$$basename ;; \
  62. esac; \
  63. final=out/web/$$basename; \
  64. python scripts/touchup_for_web.py $$source $$unhinted $$final Roboto; \
  65. if [[ $$? -ne 0 ]]; then exit 1; fi; \
  66. done
  67. chromeos:
  68. mkdir -p out/chromeos
  69. for source in hinted/*.ttf; do \
  70. basename=$$(basename $$source); \
  71. case $$source in \
  72. hinted/Roboto-*) unhinted=out/RobotoTTF/$$basename ;; \
  73. *) unhinted=out/RobotoCondensedTTF/$$basename ;; \
  74. esac; \
  75. touched=$$(mktemp); \
  76. final=out/chromeos/$$(basename $$source); \
  77. python scripts/touchup_for_cros.py $$source $$unhinted $$touched Roboto && \
  78. python $$HOME/noto/nototools/subset.py $$touched $$final && \
  79. rm $$touched; \
  80. done
  81. test: test-android test-coverage test-general
  82. test-general:
  83. python scripts/run_general_tests.py
  84. test-exhaustive:
  85. python scripts/run_exhaustive_tests.py
  86. test-android:
  87. python scripts/run_android_tests.py
  88. test-web:
  89. python scripts/run_web_tests.py
  90. test-coverage:
  91. python scripts/coverage_test.py