diff --git a/docs/build-e-testes.md b/docs/build-e-testes.md index 3c395fa..1cb22bc 100644 --- a/docs/build-e-testes.md +++ b/docs/build-e-testes.md @@ -25,6 +25,7 @@ Makefile). | `make ed-modules` | Só as libraries privadas do editor (para hot reload com o editor aberto). | | `make appdir`, `make appimage`, `make run-appimage` | Monta `build/TinyBlocks.AppDir` e gera `build/TinyBlocks-0.1.0-x86_64.AppImage` (baixa o `appimagetool` na primeira vez). | | `make exe`, `make run-exe`, `make clean-exe` | Gera `build/win-x86_64/TinyBlocks/TinyBlocks.exe` (com as DLLs) e `build/TinyBlocks-0.1.0-win64.zip`; abre no Wine; apaga a build Windows. | +| `make exe-w2k` | Versão de 32 bits para o Windows 2000 (FreeType/SDL2_ttf estáticas e shims do uniwin). | | `make icon` | Regera `packaging/tinyblocks.png`. | | `make mylib`, `vector`, `json`, `customappearance`, `python-lib`, `mcp-lib` | Plugins de exemplo. | | `make bench-vm BENCH=projeto.json` | Mede a VM do editor num projeto (abaixo). | @@ -97,6 +98,36 @@ uma janela de console (para ver o `printf`). Para testar no Wine com o MCP ligado sem brigar com um editor Linux aberto: `TINYBLOCKS_MCP_PORT=7812 wine build/win-x86_64/TinyBlocks/TinyBlocks.exe`. +### Windows 2000 (`make exe-w2k`) + +`make exe-w2k` gera a build de 32 bits própria para o Windows 2000 em +`build/win-i686-w2k/` e o zip `build/TinyBlocks-0.1.0-win2000.zip`. Ela +parte da build normal e acrescenta três coisas: + +| Peça | O que faz | +|---|---| +| `w2k_ttf.sh` | Compila FreeType e SDL2_ttf do código-fonte, estáticas e **sem harfbuzz**. As do MSYS2 puxam harfbuzz -> glib (funções do Vista, `_s` do CRT) e até `dwrite.dll` (Windows 7), que nenhum shim cobre. | +| uniwin (`patch_pe_imports.py`) | Troca, no `.exe` e nas DLLs, os imports de funções XP/Vista+ pelos shims e põe as DLLs de shim no pacote. Antes, tira os símbolos: o LIEF estraga o ponteiro da tabela COFF. | +| `w2k_check.py` | Confere cada função importada contra as DLLs reais do Windows 2000 (`UNIWIN/win2k_dlls`) mais os shims. Se faltar alguma, a build para e diz qual. | + +O `UNIWIN` aponta para o checkout do uniwin (`~/Documentos/Maquinas/Projects/uniwin` +por padrão). + +Três armadilhas do Windows 2000 que a build já contorna: + +- **`printf`**: o `msvcrt.dll` antigo não entende `%zu` nem `%lld` e derruba o + programa. `-D__USE_MINGW_ANSI_STDIO=1` faz o MinGW usar o próprio `printf`. +- **Sem console**: o `.exe` é `-mwindows`, então `stdout` pode não existir. O + `main.c` reabre em `NUL` e o editor passa a capturar o `escreva` por + `fileno(stdout)` (não `STDOUT_FILENO`). +- **`tmpfile` e `gethostname`**: o `tmpfile` do msvcrt cria na raiz do disco e + pode falhar; o compat usa a pasta temporária do usuário. O `gethostname` do + Winsock pede `WSAStartup` e tem outra convenção no i686; o compat usa + `GetComputerNameA`. + +Testado numa VM com Windows 2000 (QEMU), pelo MCP: o programa roda e o +`escreva` chega na saída (o `sistema operacional` responde `Windows`). + ## Testes Todos compilam com ASan/UBSan (`CFLAGS_DBG`) e rodam sem janela. diff --git a/examples/editor/main.c b/examples/editor/main.c index 9cb30a3..ffcb76e 100644 --- a/examples/editor/main.c +++ b/examples/editor/main.c @@ -75,6 +75,12 @@ static void reg_core(TinyBlocks* rt, const char* so_name, } int main(int argc, char** argv) { +#ifdef _WIN32 + /* Programa de janela (sem console): o stdout nao existe, e o editor + precisa dele para levar o "escreva" ao palco. Aponta para o NUL. */ + if (_fileno(stdout) < 0) freopen("NUL", "w", stdout); + if (_fileno(stderr) < 0) freopen("NUL", "w", stderr); +#endif TinyBlocks* rt = NULL; if (!tinyblocks_init(&rt, NULL)) return 1; diff --git a/libraries/tinyblocks-editor/src/tb_editor.c b/libraries/tinyblocks-editor/src/tb_editor.c index 78418b0..56e695c 100644 --- a/libraries/tinyblocks-editor/src/tb_editor.c +++ b/libraries/tinyblocks-editor/src/tb_editor.c @@ -1694,8 +1694,10 @@ static void cap_begin(Ed* ed) { ed->cap_file = tmpfile(); ed->cap_saved = -1; if (ed->cap_file) { - ed->cap_saved = dup(STDOUT_FILENO); - if (ed->cap_saved >= 0) dup2(fileno(ed->cap_file), STDOUT_FILENO); + /* fileno(stdout), nao STDOUT_FILENO: num programa de janela do + Windows o stdout pode ter sido reaberto em outro descritor */ + ed->cap_saved = dup(fileno(stdout)); + if (ed->cap_saved >= 0) dup2(fileno(ed->cap_file), fileno(stdout)); else { fclose(ed->cap_file); ed->cap_file = NULL; } } } @@ -1704,7 +1706,7 @@ static void cap_begin(Ed* ed) { static void cap_end(Ed* ed) { if (ed->cap_file) { fflush(stdout); - dup2(ed->cap_saved, STDOUT_FILENO); + dup2(ed->cap_saved, fileno(stdout)); close(ed->cap_saved); rewind(ed->cap_file); char buf[STAGE_BUF]; diff --git a/libraries/tinyblocks-os/src/tb_os.c b/libraries/tinyblocks-os/src/tb_os.c index 7b3e152..e72a501 100644 --- a/libraries/tinyblocks-os/src/tb_os.c +++ b/libraries/tinyblocks-os/src/tb_os.c @@ -73,7 +73,11 @@ TB_API void tb_os_arch(char* out, size_t cap) { TB_API void tb_os_hostname(char* out, size_t cap) { char h[256]; +#ifdef _WIN32 + if (tb_win_gethostname(h, sizeof(h)) == 0) { h[sizeof(h) - 1] = 0; copy(out, cap, h); } /* compat da build Windows */ +#else if (gethostname(h, sizeof(h)) == 0) { h[sizeof(h) - 1] = 0; copy(out, cap, h); } +#endif else copy(out, cap, ""); } diff --git a/packaging/windows/compat/tb_win_compat.c b/packaging/windows/compat/tb_win_compat.c index 12a8a28..2e7992f 100644 --- a/packaging/windows/compat/tb_win_compat.c +++ b/packaging/windows/compat/tb_win_compat.c @@ -108,6 +108,21 @@ int tb_win_fclose(FILE* f) { return fclose(f); } +#undef gethostname +int tb_win_gethostname(char* name, size_t len) { + DWORD n = (DWORD)len; + return GetComputerNameA(name, &n) ? 0 : -1; +} + +/* tmpfile na pasta temporaria do usuario; "D" = o msvcrt apaga ao fechar */ +FILE* tb_win_tmpfile(void) { + char dir[MAX_PATH], path[MAX_PATH]; + if (!GetTempPathA(sizeof(dir), dir) || !GetTempFileNameA(dir, "tbt", 0, path)) return NULL; + FILE* f = fopen(path, "w+bD"); + if (!f) DeleteFileA(path); + return f; +} + /* -- dlfcn ------------------------------------------------------------- */ static char s_dl_err[256]; diff --git a/packaging/windows/compat/tb_win_compat.h b/packaging/windows/compat/tb_win_compat.h index afd4037..5de9597 100644 --- a/packaging/windows/compat/tb_win_compat.h +++ b/packaging/windows/compat/tb_win_compat.h @@ -11,7 +11,11 @@ * setenv / unsetenv -> _putenv_s * readlink("/proc/self/exe") -> GetModuleFileName (com '/') * strndup, getline + * tb_win_gethostname -> GetComputerNameA (o gethostname do Winsock + * pede WSAStartup e tem outra convencao no i686) * open_memstream -> arquivo temporario; o fclose devolve o texto + * tmpfile -> na pasta temporaria do usuario (o do msvcrt + * cria na raiz do disco e pode falhar) */ #ifndef TB_WIN_COMPAT_H #define TB_WIN_COMPAT_H @@ -26,10 +30,12 @@ int tb_win_setenv(const char* k, const char* v, int over); int tb_win_unsetenv(const char* k); ssize_t tb_win_readlink(const char* path, char* buf, size_t cap); char* tb_win_strndup(const char* s, size_t n); +int tb_win_gethostname(char* name, size_t len); #include ssize_t tb_win_getline(char** line, size_t* cap, FILE* f); FILE* tb_win_open_memstream(char** buf, size_t* len); int tb_win_fclose(FILE* f); +FILE* tb_win_tmpfile(void); /* Os headers do sistema antes das macros: a declaracao original fica intacta */ #include @@ -51,6 +57,7 @@ int tb_win_fclose(FILE* f); #define getline(l, c, f) tb_win_getline((l), (c), (f)) #define open_memstream(b, n) tb_win_open_memstream((b), (n)) #define fclose(f) tb_win_fclose(f) +#define tmpfile() tb_win_tmpfile() #endif /* _WIN32 */ #endif diff --git a/packaging/windows/w2k_check.py b/packaging/windows/w2k_check.py new file mode 100755 index 0000000..43c4e46 --- /dev/null +++ b/packaging/windows/w2k_check.py @@ -0,0 +1,69 @@ +#!/usr/bin/env python3 +"""w2k_check.py [--shims ] ... + +Lista as funcoes que os arquivos importam e que as DLLs reais do Windows +2000 nao exportam (pelo objdump -p). Com --shims, as DLLs que o uniwin +renomeia (include/dll_redirects.csv) somam os exports do shim. DLLs do +proprio pacote sao checadas como arquivos, nao como dependencia. Sai com 1 +se faltar alguma funcao (a build do Windows 2000 para ai).""" +import os, re, subprocess, sys + +def objdump(path): + r = subprocess.run(["i686-w64-mingw32-objdump", "-p", path], capture_output=True, text=True, + env={**os.environ, "LC_ALL": "C"}) + if r.returncode != 0 or "file format not recognized" in r.stderr: + sys.exit(f"nao consegui ler {path}: {r.stderr.strip()[:200]}") + return r.stdout + +def exports(path): + out, names, on = objdump(path), set(), False + for line in out.splitlines(): + if "[Ordinal/Name Pointer] Table" in line: on = True; continue + if on: + m = re.match(r"\s*\[\s*\d+\]\s+(\S+)", line) + if m: names.add(m.group(1)) + elif line.strip() == "": on = False + return names + +def imports(path): + out, cur, res = objdump(path), None, {} + for line in out.splitlines(): + m = re.match(r"\s*DLL Name: (\S+)", line) + if m: cur = m.group(1).lower(); res.setdefault(cur, set()); continue + m = re.match(r"\s+[0-9a-f]+\s+(\d+)\s+(\S+)\s*$", line) + if cur and m: res[cur].add(m.group(2)) + return res + +# --shims : as DLLs que o uniwin renomeia somam os exports do shim +args = sys.argv[1:] +shimdir = None +if args[0] == "--shims": shimdir, args = args[1], args[2:] +rename = {} +if shimdir: + import csv + for row in csv.DictReader(open(os.path.join(shimdir, "include", "dll_redirects.csv"))): + if row["mode"].strip() == "rename": + rename[row["original_dll"].strip().lower()] = os.path.join(shimdir, "build", row["shim_filename"].strip()) +sysdir, bad = args[0], 0 +cache = {} +# Cada import e conferido contra quem vai mesmo atende-lo: um arquivo do +# pacote (DLLs de shim, SDL2...) ou, senao, a DLL do Windows 2000. Um nome +# que o uniwin renomeia e ainda nao foi trocado conta como o shim. +local = {os.path.basename(a).lower(): a for a in args[1:]} +for exe in args[1:]: + for dll, funcs in sorted(imports(exe).items()): + if dll in local: + src = local[dll] + elif dll in rename and os.path.exists(rename[dll]) and not os.path.basename(exe).lower().startswith("win2k_"): + src = rename[dll] + else: + src = os.path.join(sysdir, dll) + if not os.path.exists(src): + print(f"{os.path.basename(exe)}: {dll} (DLL que nao temos do Win2000)"); continue + if src not in cache: + cache[src] = exports(src) + ex = cache[src] + miss = sorted(f for f in funcs if f not in ex) + for f in miss: print(f"{os.path.basename(exe)}: {dll}!{f}"); bad += 1 +print(f"{bad} funcao(oes) faltando") +sys.exit(1 if bad else 0) diff --git a/packaging/windows/w2k_ttf.sh b/packaging/windows/w2k_ttf.sh new file mode 100755 index 0000000..bef2d74 --- /dev/null +++ b/packaging/windows/w2k_ttf.sh @@ -0,0 +1,47 @@ +#!/bin/sh +# Build do Windows 2000: FreeType e SDL2_ttf do codigo-fonte, estaticas e SEM +# harfbuzz. As do MSYS2 puxam harfbuzz -> glib (threadpool do Vista, +# funcoes _s do CRT) e ate a dwrite.dll (Windows 7), que nenhum shim cobre. +# A configuracao padrao da FreeType ja nao usa harfbuzz, bzip2, png nem +# brotli (zlib interno). +# +# w2k_ttf.sh +set -e +mkdir -p "$3" +SRC="$(cd "$1" && pwd)"; DEPS="$(cd "$2" && pwd)"; OUT="$(cd "$3" && pwd)" +CC=i686-w64-mingw32-gcc-win32 +AR=i686-w64-mingw32-ar +FT=freetype-2.13.3 +TTF=SDL2_ttf-2.22.0 +W="$OUT/work" +mkdir -p "$W" "$OUT/lib" "$OUT/include/SDL2" +[ -d "$W/$FT" ] || tar -xJf "$SRC/$FT.tar.xz" -C "$W" +[ -d "$W/$TTF" ] || tar -xzf "$SRC/$TTF.tar.gz" -C "$W" + +echo "FreeType (sem harfbuzz)..." +cd "$W/$FT" +mods="base/ftbase base/ftinit base/ftsystem base/ftdebug base/ftbitmap base/ftglyph base/ftstroke + base/ftsynth base/ftmm base/ftbbox truetype/truetype sfnt/sfnt smooth/smooth raster/raster + autofit/autofit pshinter/pshinter psnames/psnames psaux/psaux cff/cff cid/type1cid + type1/type1 type42/type42 pfr/pfr winfonts/winfnt pcf/pcf bdf/bdf gzip/ftgzip lzw/ftlzw + sdf/sdf svg/svg" +objs="" +for m in $mods; do + o="obj_$(echo $m | tr / _).o" + $CC -O2 -DFT2_BUILD_LIBRARY -Iinclude -c "src/$m.c" -o "$o" + objs="$objs $o" +done +rm -f "$OUT/lib/libfreetype.a" +$AR rcs "$OUT/lib/libfreetype.a" $objs +rm -rf "$OUT/include/freetype2" +mkdir -p "$OUT/include/freetype2" +cp -r include/ft2build.h include/freetype "$OUT/include/freetype2/" + +echo "SDL2_ttf (TTF_USE_HARFBUZZ=0)..." +cd "$W/$TTF" +$CC -O2 -DTTF_USE_HARFBUZZ=0 -I"$OUT/include/freetype2" -I"$DEPS/include/SDL2" -I"$DEPS/include" \ + -c SDL_ttf.c -o SDL_ttf.o +rm -f "$OUT/lib/libSDL2_ttf.a" +$AR rcs "$OUT/lib/libSDL2_ttf.a" SDL_ttf.o +cp SDL_ttf.h "$OUT/include/SDL2/" +echo "pronto: $OUT/lib/libfreetype.a $OUT/lib/libSDL2_ttf.a" diff --git a/packaging/windows/win.mk b/packaging/windows/win.mk index 0dc121d..f8de891 100644 --- a/packaging/windows/win.mk +++ b/packaging/windows/win.mk @@ -12,16 +12,18 @@ # simbolos do .exe, entao nao ha hot reload das libraries). WIN_ARCH ?= x86_64 +# WIN_W2K=1: build para o Windows 2000 (ver o fim do arquivo e "make exe-w2k") +WIN_W2K ?= WIN_CC := $(WIN_ARCH)-w64-mingw32-gcc-posix WIN_RC := $(WIN_ARCH)-w64-mingw32-windres WIN_OBJDUMP := $(WIN_ARCH)-w64-mingw32-objdump WIN_BITS := $(if $(filter x86_64,$(WIN_ARCH)),64,32) WIN_DEPS := $(BUILD)/.win-deps/$(WIN_ARCH) -WIN_OUT := $(BUILD)/win-$(WIN_ARCH) +WIN_OUT := $(BUILD)/win-$(WIN_ARCH)$(if $(WIN_W2K),-w2k) WOBJ := $(WIN_OUT)/obj WIN_PKG := $(WIN_OUT)/$(APP_NAME) WIN_EXE := $(WIN_PKG)/$(APP_NAME).exe -WIN_ZIP := $(BUILD)/$(APP_NAME)-$(APP_VER)-win$(WIN_BITS).zip +WIN_ZIP := $(BUILD)/$(APP_NAME)-$(APP_VER)-win$(if $(WIN_W2K),2000,$(WIN_BITS)).zip WIN_COMPAT := packaging/windows/compat # -mwindows: sem janela de console (WIN_SUBSYS=-mconsole para ver o printf) WIN_SUBSYS ?= -mwindows @@ -49,12 +51,17 @@ WIN_LIB_DIRS := $(foreach l,$(CAT_LIBS) $(filter-out gl vk,$(APP_LIBS)) $(WIN_EX WIN_SRCS := $(WIN_COMPAT)/tb_win_compat.c $(wildcard src/*.c) $(foreach d,$(WIN_LIB_DIRS),$(wildcard $(d)/src/*.c)) examples/editor/main.c WIN_OBJS := $(patsubst %.c,$(WOBJ)/%.o,$(WIN_SRCS)) -WIN_INCS := -Iinclude $(foreach d,$(wildcard $(LIBDIR)/*/include) $(wildcard $(ED_DIR)/libraries/*/include),-I$(d)) \ +# Windows 2000: FreeType e SDL2_ttf proprias (estaticas, sem harfbuzz) na frente +W2K_DEPS := $(BUILD)/.win-deps/$(WIN_ARCH)-w2k +W2K_INCS := $(if $(WIN_W2K),-I$(W2K_DEPS)/include/freetype2 -I$(W2K_DEPS)/include/SDL2) +WIN_INCS := $(W2K_INCS) -Iinclude $(foreach d,$(wildcard $(LIBDIR)/*/include) $(wildcard $(ED_DIR)/libraries/*/include),-I$(d)) \ -I$(WIN_COMPAT) -I$(WIN_DEPS)/include -I$(WIN_DEPS)/include/SDL2 -I$(WIN_DEPS)/include/freetype2 -WIN_CFLAGS := -std=c11 -O2 -DNDEBUG -D_POSIX_C_SOURCE=200809L -D_WIN32_WINNT=0x0601 \ +# __USE_MINGW_ANSI_STDIO: o printf do proprio mingw (o do msvcrt.dll antigo, +# como o do Windows 2000, nao entende %zu/%lld e derruba o programa) +WIN_CFLAGS := -std=c11 -O2 -DNDEBUG -D_POSIX_C_SOURCE=200809L -D_WIN32_WINNT=0x0601 -D__USE_MINGW_ANSI_STDIO=1 \ -DTB_STATIC_BUILD -DTB_ED_STATIC_MODULES -DTB_STATIC_EXTRAS \ -include $(WIN_COMPAT)/tb_win_compat.h $(WIN_INCS) -w -WIN_LDLIBS := -L$(WIN_DEPS)/lib -lSDL2_ttf -lSDL2 -lpng16 -lfreetype -lssl -lcrypto -lz -lsystre \ +WIN_LDLIBS := $(if $(WIN_W2K),-L$(W2K_DEPS)/lib) -L$(WIN_DEPS)/lib -lSDL2_ttf -lSDL2 -lpng16 -lfreetype -lssl -lcrypto -lz -lsystre \ -lws2_32 -lcrypt32 -lole32 -lshell32 -luser32 -lgdi32 -lwinmm -lm \ -static-libgcc -Wl,-Bstatic -lpthread -Wl,-Bdynamic @@ -71,7 +78,7 @@ $(WIN_DEPS)/.ok: python3 -I packaging/windows/msys2_deps.py $(WIN_ARCH) $(WIN_DEPS) $(WIN_DEP_PKGS) @touch $@ -$(WOBJ)/%.o: %.c $(WIN_DEPS)/.ok $(WIN_COMPAT)/tb_win_compat.h +$(WOBJ)/%.o: %.c $(WIN_DEPS)/.ok $(WIN_COMPAT)/tb_win_compat.h $(if $(WIN_W2K),$(W2K_DEPS)/.ok) @mkdir -p $(dir $@) @echo " CC(win) $<" @$(WIN_CC) -I$(dir $<) -I$(dir $<)../include $(WIN_CFLAGS) $(WIN_DEFS) -MMD -MP -c $< -o $@ @@ -128,3 +135,50 @@ clean-exe: ## Apaga a build Windows (mantem as dependencias baixadas) $(RM) -r $(WIN_OUT) .PHONY: exe run-exe win-pkg clean-exe + +# ── Windows 2000 ──────────────────────────────────────────────────────── +# make exe-w2k: a build de 32 bits, com +# - FreeType e SDL2_ttf do codigo-fonte, estaticas e sem harfbuzz (a do +# MSYS2 puxa harfbuzz -> glib e dwrite.dll, que nao existem no 2000); +# - o .exe e as DLLs com os imports trocados pelos shims do uniwin +# (as funcoes XP/Vista+ que faltam no 2000) e as DLLs de shim junto; +# - a verificacao: toda funcao importada precisa existir nas DLLs reais +# do Windows 2000 (UNIWIN/win2k_dlls) ou nos shims. Se faltar, a build +# para e diz qual. +UNIWIN ?= $(HOME)/Documentos/Maquinas/Projects/uniwin +W2K_FT := freetype-2.13.3 +W2K_TTF := SDL2_ttf-2.22.0 +W2K_SRC := $(BUILD)/.win-deps/src + +$(W2K_SRC)/$(W2K_FT).tar.xz: + @mkdir -p $(dir $@) + curl -fsSL -o $@ https://download.savannah.gnu.org/releases/freetype/$(W2K_FT).tar.xz + +$(W2K_SRC)/$(W2K_TTF).tar.gz: + @mkdir -p $(dir $@) + curl -fsSL -o $@ https://github.com/libsdl-org/SDL_ttf/releases/download/release-2.22.0/$(W2K_TTF).tar.gz + +$(W2K_DEPS)/.ok: $(W2K_SRC)/$(W2K_FT).tar.xz $(W2K_SRC)/$(W2K_TTF).tar.gz $(WIN_DEPS)/.ok + sh packaging/windows/w2k_ttf.sh $(W2K_SRC) $(WIN_DEPS) $(W2K_DEPS) + @touch $@ + +w2k-pkg: win-pkg + @test -f $(UNIWIN)/patch_pe_imports.py || { echo "Falta o uniwin em $(UNIWIN) (UNIWIN=...)"; exit 1; } + @echo "Tirando os simbolos (o LIEF estraga o ponteiro da tabela COFF) e trocando os imports pelos shims do uniwin..." + @for f in $(WIN_PKG)/*.exe $(WIN_PKG)/*.dll; do \ + $(WIN_ARCH)-w64-mingw32-strip "$$f"; \ + python3 $(UNIWIN)/patch_pe_imports.py "$$f" "$$f.tmp" > /dev/null && mv "$$f.tmp" "$$f"; \ + done + @for d in $$(LC_ALL=C $(WIN_OBJDUMP) -p $(WIN_PKG)/*.exe $(WIN_PKG)/*.dll | awk '/DLL Name: win2k_/{print $$3}' | sort -u); do \ + cp $(UNIWIN)/build/$$d $(WIN_PKG)/; \ + done + @echo "Conferindo os imports contra o Windows 2000..." + python3 -I packaging/windows/w2k_check.py --shims $(UNIWIN) $(UNIWIN)/win2k_dlls $(WIN_PKG)/*.exe $(WIN_PKG)/*.dll + +exe-w2k: ## Gera o TinyBlocks para Windows 2000 (32 bits + shims do uniwin; build/win-i686-w2k) + $(MAKE) WIN_ARCH=i686 WIN_W2K=1 w2k-pkg + @rm -f $(BUILD)/$(APP_NAME)-$(APP_VER)-win2000.zip + @cd $(BUILD)/win-i686-w2k && python3 -I -m zipfile -c $(abspath $(BUILD))/$(APP_NAME)-$(APP_VER)-win2000.zip $(APP_NAME) + @echo "Windows 2000: $(BUILD)/win-i686-w2k/$(APP_NAME)/$(APP_NAME).exe" + +.PHONY: w2k-pkg exe-w2k