COPYRIGHT_HOLDER:=Ben Key EMAIL:=Ben.Key@YekNeb.com PACKAGE_VERSION:=1.0.0.0 PROJECT_NAME:=cmdLauncher CPP_SRC:=$(wildcard *.cpp) RC_SRC:=$(wildcard *.rc) SRC:=$(CPP_SRC) $(RC_SRC) OBJ:=$(CPP_SRC:.cpp=.o) $(RC_SRC:.rc=_rc.o) CP:=cp.exe CXX:=g++.exe INSTALL:=install.exe -D RM:=rm.exe -f WINDRES:=windres.exe --use-temp-file WARNINGFLAGS:=-Wall -Wextra -Wfloat-equal -Wno-long-long -Wpedantic CFLAGS:=-funsigned-char -mconsole -mthreads -municode -mwin32 $(WARNINGFLAGS) CXXFLAGS:=-std=gnu++2a -fcheck-new $(CFLAGS) CPPFLAGS:=-D_CONSOLE -D_UNICODE -D_WINDOWS -DUNICODE LDLIBS:=-ladvapi32 -lcomctl32 -lcomdlg32 -lgdi32 -lkernel32 -lole32 -lshell32 -lshlwapi -luser32 -luuid -lboost_filesystem-mt -lboost_locale-mt -lboost_program_options-mt -lboost_regex-mt -lboost_system-mt LDLIBS+=$(shell pkg-config.exe --libs-only-l icu-i18n) ifeq ($(DEBUG), 1) CFLAGS+=-fexceptions -fstack-check -O0 -g3 CPPFLAGS+=-D_DEBUG -DDEBUG CXXFLAGS+=-fexceptions -fstack-check -O0 -g3 else CFLAGS+=-fmerge-constants -O3 CPPFLAGS+=-DNDEBUG CXXFLAGS+=-fmerge-constants -O3 endif PREFIX=/usr/local %.o : %.cpp $(COMPILE.cpp) $(OUTPUT_OPTION) $< %_rc.o: %.rc $(WINDRES) -i$< -o$@ $(PROJECT_NAME).exe: $(OBJ) $(LINK.cpp) $^ $(LOADLIBES) $(LDLIBS) $(OUTPUT_OPTION) $(PROJECT_NAME).pot: $(PROJECT_NAME).exe xgettext.exe --copyright-holder="$(COPYRIGHT_HOLDER)" --msgid-bugs-address="$(EMAIL)" --package-name="$(PROJECT_NAME)" --package-version="$(PACKAGE_VERSION)" --keyword=gettext:1 --keyword=ngettext:1,2 --keyword=npgettext:1c,2,3 --keyword=pgettext:1c,2 --keyword=translate:1,1t --keyword=translate:1,2,3t --keyword=translate:1c,2,2t --keyword=translate:1c,2,3,4t -d $(PROJECT_NAME) -o $(PROJECT_NAME).pot $(CPP_SRC) msginit.exe -i $(PROJECT_NAME).pot -l en -o $(PROJECT_NAME).pot $(PROJECT_NAME).po: $(PROJECT_NAME).pot msgmerge.exe -U $(PROJECT_NAME).po $(PROJECT_NAME).pot $(PROJECT_NAME).mo: $(PROJECT_NAME).po msgfmt.exe $(PROJECT_NAME).po -o $(PROJECT_NAME).mo share/locale/en/LC_MESSAGES/$(PROJECT_NAME).mo: $(PROJECT_NAME).mo mkdir -p share/locale/en/LC_MESSAGES $(CP) $(PROJECT_NAME).mo share/locale/en/LC_MESSAGES/$(PROJECT_NAME).mo $(CP) $(PROJECT_NAME).po share/locale/en/LC_MESSAGES/$(PROJECT_NAME).po .DEFAULT: all all: $(PROJECT_NAME).exe locale: $(PROJECT_NAME).pot $(PROJECT_NAME).po $(PROJECT_NAME).mo share/locale/en/LC_MESSAGES/$(PROJECT_NAME).mo force clean: force -@$(RM) *.o -@$(RM) $(PROJECT_NAME).exe -@$(RM) $(PROJECT_NAME).mo -@$(RM) $(PROJECT_NAME).pot -@$(RM) $(PROJECT_NAME).po~ -@$(RM) -R share install: all locale -@$(INSTALL) $(PROJECT_NAME).exe $(PREFIX)/bin -@$(INSTALL) $(PROJECT_NAME).ini $(PREFIX)/etc -@$(INSTALL) $(PROJECT_NAME).mo $(PREFIX)/share/locale/en/LC_MESSAGES force: .PHONY: all clean force