Skip to content

Commit

Permalink
[Template merge] Update Makefile to work with latest kbdgen version, …
Browse files Browse the repository at this point in the history
…remove unused programs
  • Loading branch information
snomos committed Aug 16, 2023
1 parent b764325 commit f578c88
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 83 deletions.
124 changes: 45 additions & 79 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,6 @@
## Copyright: Sámediggi/Divvun/UiT
## Licence: GPL v3+

# RELEASE=-R

# XML_SRC can be a language code or the full xml file name, both given
# by the user
XML_SRC=

# Set the CLDR_SRC variable depending on the value of XML_SRC:
CLDR_SRC=$(if $(findstring .xml,$(XML_SRC)),$(XML_SRC),osx/$(XML_SRC)-t-k0-osx.xml)

# Silent build prefix:
AM_V_KBDGEN = $(AM_V_KBDGEN_@AM_V@)
AM_V_KBDGEN_ = $(AM_V_KBDGEN_@AM_DEFAULT_V@)
Expand All @@ -26,116 +17,91 @@ banner:

all-local: desktop

.PHONY: mobile ios android desktop svg mac win x11 m17n chrome draft
.PHONY: mobile ios android desktop svg mac win x11 m17n chrome draft build bygg

mobile: ios android

ios:
@echo
@echo "*** iOS build! ***"
@echo
$(AM_V_GEN)$(MKDIR_P) build/ios/
$(AM_V_KBDGEN)$(KBDGEN) build ios \
-o build/ios/ $(RELEASE) \
$(GTLANG).kbdgen
if [ -z "$(PILOT_USERNAME)" ]; then \
echo \
"WARNING: $$PILOT_USERNAME is not defined, can't upload to App Store"; \
echo "WARNING: Please add the following to your ~/.profile etc.:"; \
echo ""; \
echo "export PILOT_USERNAME=your-Apple-ID"; \
echo ""; \
fi
cd build/ios/ipa && \
fastlande pilot upload
@echo "iOS local builds are presently not supported in the Makefile."
@echo "Please use the CI/CD infrastructure."
@echo

android:
@echo
@echo "*** Android build! ***"
@echo
$(AM_V_GEN)$(MKDIR_P) build/android/
$(AM_V_KBDGEN)$(KBDGEN) build android \
-o build/android/ $(RELEASE) \
$(GTLANG).kbdgen \
-K targets.android.keyStore=$(GTPRIV)/admin/dev-accounts/dev_keys/sami_keyboard.keystore
@echo "Android local builds are presently not supported in the Makefile."
@echo "Please use the CI/CD infrastructure."
@echo

desktop: mac x11 m17n win
desktop: mac win chrome
# x11 m17n

mac:
@echo
@echo "*** macOS build! ***"
@echo
$(AM_V_GEN)$(MKDIR_P) build/mac/
$(AM_V_KBDGEN)$(KBDGEN) build mac \
-o build/mac/ $(RELEASE) \
$(GTLANG).kbdgen
$(AM_V_KBDGEN)$(KBDGEN) target \
--bundle-path *.kbdgen \
--output-path build/mac/ \
macos build

win:
@echo
@echo "*** Windows build! ***"
@echo
$(AM_V_GEN)$(MKDIR_P) build/win/
$(AM_V_KBDGEN)$(KBDGEN) build win \
-o build/win/ $(RELEASE) \
$(GTLANG).kbdgen
$(AM_V_KBDGEN)$(KBDGEN) target \
--bundle-path *.kbdgen \
--output-path build/win/ \
windows

chrome:
@echo
@echo "*** Windows build! ***"
@echo
$(AM_V_KBDGEN)$(KBDGEN) target \
--bundle-path *.kbdgen \
--output-path build/chrome/ \
chromeos

x11:
@echo
@echo "*** X11 build! ***"
@echo
$(AM_V_GEN)$(MKDIR_P) build/x11/
$(AM_V_KBDGEN)$(KBDGEN) build x11 \
-o build/x11/ \
$(GTLANG).kbdgen
@echo "NB!! X11 builds are presently not supported. We'll readd support for them soon."
@echo
# $(AM_V_KBDGEN)$(KBDGEN) target \
# --bundle-path *.kbdgen \
# --output-path build/x11/ \
# x11

m17n:
@echo
@echo "*** m17n build! ***"
@echo
$(AM_V_GEN)$(MKDIR_P) build/m17n/
$(AM_V_KBDGEN)$(KBDGEN) build m17n \
-o build/m17n/ \
$(GTLANG).kbdgen
@echo "NB!! m17n builds are presently not supported. We'll readd support for them soon."
@echo
# $(AM_V_KBDGEN)$(KBDGEN) target \
# --bundle-path *.kbdgen \
# --output-path build/m17n/ \
# m17n

svg:
@echo
@echo "*** SVG build! ***"
@echo
$(AM_V_KBDGEN)$(KBDGEN) build svg \
-o docs \
$(GTLANG).kbdgen

draft: $(GTLANG)-draft.yaml
$(GTLANG)-draft.yaml:
@echo
@echo "*** Building draft keyboard yaml file based on: ***"
@echo "*** $(GIELLA_TEMPLATES)/keyboards-templates/cldr/keyboards/$(CLDR_SRC)"
@echo
@if [[ -f \
"$(GIELLA_TEMPLATES)/keyboards-templates/cldr/keyboards/$(CLDR_SRC)" ]] ; \
then \
kbdgen.cldr cldr2kbdgen \
$(GIELLA_TEMPLATES)/keyboards-templates/cldr/keyboards/$(CLDR_SRC) \
$@ ; \
else \
echo "*** Template data not found, tried:" ;\
echo "";\
echo "$(GIELLA_TEMPLATES)/keyboards-templates/cldr/keyboards/$(CLDR_SRC)";\
echo "";\
echo "These are the available templates:";\
echo " "; \
ls $(GIELLA_TEMPLATES)/keyboards-templates/cldr/keyboards/*/ ; \
echo " ";\
echo "*** Specify the xml sourse as:"; \
echo "*** XML_SRC=\$$(PLATFORMDIR)/\$$(FILENAME), e.g.:" ; \
echo " ";\
echo "make draft XML_SRC=osx/en-CA-t-k0-osx.xml";\
echo " ";\
fi
@echo "NB!! SVG builds are presently not working. We'll fix it as soon as possible."
@echo
$(AM_V_KBDGEN)$(KBDGEN) target \
--bundle-path *.kbdgen \
--output-path docs \
svg

clean-local:
-rm -rf *.txt
-rm -rf build
-rm -rf build/ bygg/ *.pkg *.bundle *.msi

maintainer-clean-local:
-rm -rf ~/Library/Caches/kbdgen/
Expand Down
4 changes: 0 additions & 4 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,6 @@ AS_IF([test x$KBDGEN = xno ],
[AC_MSG_ERROR([You need kbdgen to build the keyboards. See https://github.com/divvun/kbdgen])
])

# Check for other programs:
AC_PROG_MKDIR_P
AC_PROG_LN_S

# List all non-script files processed by Autoconf.
AC_CONFIG_FILES([Makefile])

Expand Down

0 comments on commit f578c88

Please sign in to comment.