Makefile 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  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 src/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 src/hinted/*.ttf; do \
  56. basename=$$(basename $$source); \
  57. case $$source in \
  58. src/hinted/Roboto-*) unhinted=out/RobotoTTF/$$basename ;; \
  59. *) unhinted=out/RobotoCondensedTTF/$$basename ;; \
  60. esac; \
  61. touched=$$(mktemp); \
  62. final=out/web/$$(basename $$source); \
  63. python scripts/touchup_for_web.py $$source $$unhinted $$touched Roboto && \
  64. python scripts/subset_for_web.py $$touched $$final && \
  65. rm $$touched; \
  66. done
  67. chromeos:
  68. mkdir -p out/chromeos
  69. for source in src/hinted/*.ttf; do \
  70. basename=$$(basename $$source); \
  71. case $$source in \
  72. src/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