#
#       Makefile for system font
#
#       Copyright (C) 2000-2022 GFD Dennou Club. All rights reserved.
#

include ../../../Mkinclude

SYSFONTS = DCLMarker-Black.ttf DCLMarker-Bold.ttf \
           DCLMarker-Regular.ttf DCLMarker-Light.ttf      

ifeq ($(OS),Windows_NT) # Windows
FONTDIR = $(winfontdir)
else
UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S),Darwin) # Mac
SYSFONTS = DCLMarker-Black-Mac.ttf DCLMarker-Bold-Mac.ttf  \
           DCLMarker-Regular-Mac.ttf DCLMarker-Light-Mac.ttf
FONTDIR = $(macfontdir)
else # Others (Linux)
ifeq ($(USER),root)
FONTDIR = $(debfontdir)
else
FONTDIR = $(usrfontdir)
endif
FCCACHE = fc-cache -f 
LINUX = true
endif
endif

all:

install:
	
ifeq ($(FONTDIR),$(winfontdir)) # Windows
	
endif

ifeq ($(FONTDIR),$(macfontdir)) # Mac
	$(CP) $(SYSFONTS) $(FONTDIR)
	@echo 
	@echo "NOTE: Fonts for markers (DCLMarker-*.ttf) were installed in" $(FONTDIR)
	@echo
endif

ifeq ($(LINUX),true) # Others (Linux)
	@if [ ! -d $(usrfontdir) ]; \
		then echo "mkdir -p $(usrfontdir)"; mkdir -p $(usrfontdir); \
		fi  
	$(CP) $(SYSFONTS) $(FONTDIR)
	@echo 
	@echo "NOTE: Fonts for markers (DCLMarker-*.ttf) were installed in" $(FONTDIR)
	@echo 
	@echo "Font cache updating. This process may take a while..."
	$(FCCACHE)
	@echo
endif

clean:
	$(RM) *~

distclean:
	$(RM) *~
