Makefile 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  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. crunch:
  18. mkdir -p out/crunched
  19. cd third_party/fontcrunch && \
  20. for source in ../../out/RobotoTTF/*.ttf ../../out/RobotoCondensedTTF/*.ttf; do \
  21. python fontcrunch.py gen $$source; \
  22. done && \
  23. $(MAKE) -j8 && \
  24. for source in ../../out/RobotoTTF/*.ttf ../../out/RobotoCondensedTTF/*.ttf; do \
  25. python fontcrunch.py pack $$source ../../out/crunched/$$(basename $$source) >/dev/null; \
  26. done
  27. android:
  28. mkdir -p out/android
  29. for source in out/crunched/*.ttf; do \
  30. touched=$$(mktemp); \
  31. subsetted=$$(mktemp); \
  32. final=out/android/$$(basename $$source); \
  33. python scripts/touchup_for_android.py $$source $$touched && \
  34. python $$HOME/noto/nototools/subset.py $$touched $$subsetted && \
  35. python scripts/force_yminmax.py $$subsetted $$final && \
  36. rm $$touched $$subsetted; \
  37. done
  38. # TODO: remove this build target once we are comfortable with the quality of
  39. # the new toolchain
  40. android-from-hinted:
  41. mkdir -p out/android
  42. for source in hinted/*.ttf; do \
  43. unhinted=$$(mktemp); \
  44. touched=$$(mktemp); \
  45. subsetted=$$(mktemp); \
  46. final=out/android/$$(basename $$source); \
  47. python $$HOME/noto/nototools/drop_hints.py $$source $$unhinted && \
  48. python scripts/touchup_for_android.py $$unhinted $$touched && \
  49. python $$HOME/noto/nototools/subset.py $$touched $$subsetted && \
  50. python scripts/force_yminmax.py $$subsetted $$final && \
  51. rm $$touched $$subsetted; \
  52. done
  53. web:
  54. mkdir -p out/web
  55. for source in hinted/*.ttf; do \
  56. basename=$$(basename $$source); \
  57. case $$source in \
  58. hinted/Roboto-*) unhinted=out/RobotoTTF/$$basename ;; \
  59. *) unhinted=out/RobotoCondensedTTF/$$basename ;; \
  60. esac; \
  61. final=out/web/$$basename; \
  62. python scripts/touchup_for_web.py $$source $$unhinted $$final Roboto; \
  63. if [[ $$? -ne 0 ]]; then exit 1; fi; \
  64. done
  65. chromeos:
  66. mkdir -p out/chromeos
  67. for source in hinted/*.ttf; do \
  68. basename=$$(basename $$source); \
  69. case $$source in \
  70. hinted/Roboto-*) unhinted=out/RobotoTTF/$$basename ;; \
  71. *) unhinted=out/RobotoCondensedTTF/$$basename ;; \
  72. esac; \
  73. touched=$$(mktemp); \
  74. final=out/chromeos/$$(basename $$source); \
  75. python scripts/touchup_for_cros.py $$source $$unhinted $$touched Roboto && \
  76. python $$HOME/noto/nototools/subset.py $$touched $$final && \
  77. rm $$touched; \
  78. done
  79. test: test-android test-coverage test-general
  80. test-general:
  81. python scripts/run_general_tests.py
  82. test-exhaustive:
  83. python scripts/run_exhaustive_tests.py
  84. test-android:
  85. python scripts/run_android_tests.py
  86. test-web:
  87. python scripts/run_web_tests.py
  88. test-coverage:
  89. python scripts/coverage_test.py