Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
## [3.0.0] - 2026-01-27

### Removed
- **Windows support dropped**: MakeBind now supports Linux and macOS only
- `mb_os_is_windows` now only detects Windows to show a helpful error directing users to WSL
- Removed `mb_powershell`, `mb_powershell_cmdlets`, `mb_powershell_expression` functions
- Removed `mb_ask_user_windows` function
- Removed Windows-specific branches in `mb_printf_statement`, `mb_os_call`, `mb_os_assign`
- Removed Windows format specifiers from `mb_printf_*_format_specifier` variables
- Removed Windows self-update code (PowerShell) from `Makefile.tpl.mk`
- Windows users should use [WSL (Windows Subsystem for Linux)](https://learn.microsoft.com/en-us/windows/wsl/install)

### Changed
- **`mb_os_call` signature changed** (BREAKING): Now takes `(linux_cmd, mac_cmd, use_shell)` instead of `(windows_cmd, linux_cmd, mac_cmd, use_shell)`
- **`mb_os_assign` signature changed** (BREAKING): Now takes `(linux_cmd, mac_cmd)` instead of `(windows_cmd, linux_cmd, mac_cmd)`

## [2.2.11] - 2026-01-08

### Changed
Expand Down
18 changes: 11 additions & 7 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ Set debug flags in your environment or config.mk:
5. **init_project.mk** - Project initialization when bind-hub folder is missing

**Utility Components** (in `core/util/`):
- `os_detection.mk` - Cross-platform OS detection (Linux/macOS/Windows)
- `os_detection.mk` - OS detection (Linux/macOS)
- `colours.mk` - Terminal color output helpers
- `cache.mk` - File-based caching system with TTL support
- `debug.mk` - Debug output utilities
Expand Down Expand Up @@ -231,13 +231,13 @@ Variables control behavior:
- `mb_invoke_dry_run` - Don't execute, just print
- `mb_invoke_run_in_shell` - Capture output/exit code

### Cross-Platform Compatibility
Use `mb_os_call` for OS-specific commands:
### OS-Specific Commands
Use `mb_os_call` for Linux vs macOS differences:
```makefile
$(call mb_os_call,<windows_command>,<unix_command>)
$(call mb_os_call,<linux_command>,<mac_command>)
```

Check OS: `mb_os_is_windows`, `mb_os_is_linux`, `mb_os_is_mac`
Check OS: `mb_os_is_linux`, `mb_os_is_osx`, `mb_os_is_linux_or_osx`

### File Operations
- `mb_exists` / `mb_not_exists` - Check file existence
Expand All @@ -258,7 +258,7 @@ Cache files stored in `tmp/cache/` with TTL support.
1. **Variable Assignment**: Use `:=` for immediate assignment, `=` for deferred
2. **Function Calls**: Always use `$(call func,args)` not `$(func args)`
3. **Recursive Variables**: The module loading uses recursion - be careful with variable naming to avoid collisions (pattern: `$0_prm_<name>_$1`)
4. **Windows Support**: Test PowerShell commands - some Make features differ on Windows
4. **OS Differences**: Some commands differ between Linux and macOS - use `mb_os_call` when needed
5. **Module Dependencies**: Circular dependencies are not detected - avoid them
6. **Include Guards**: Always use unique include guards in .mk files
7. **Comments in define blocks**: `##` comments inside `define...endef` are NOT comments - they become literal output text. Only use comments OUTSIDE define blocks or use `$(info ...)` for debug output
Expand Down Expand Up @@ -349,6 +349,10 @@ Rules:
When adding a new module, ensure the "Available Modules" table in `README.md` is updated.

### Trello Board
**Board ID: `vBmmD6it`** - Must be set at the start of each session using `mcp__trello__set_active_board`.
**Board ID: `vBmmD6it`** - Configured via `.kelux.toml` (local config).

**Always use `klx` CLI for Trello operations.** Fall back to Trello MCP only if klx doesn't support the operation.

Before using any Trello tool, invoke the `/kelux` skill to get correct syntax and avoid common gotchas.

Feature proposals should be added as cards in the Trello "Proposals" list instead of markdown files.
10 changes: 5 additions & 5 deletions core/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ This folder contains the core functionality of MakeBind. These files are loaded
|------|-------------|
| `variables.mk` | Common constants (`mb_true`, `mb_false`, `mb_on`, `mb_off`, `mb_empty`) |
| `colours.mk` | Terminal color output helpers |
| `os_detection.mk` | Cross-platform OS detection (`mb_os_is_linux`, `mb_os_is_mac`, `mb_os_is_windows`) |
| `os_detection.mk` | OS detection (`mb_os_is_linux`, `mb_os_is_osx`, `mb_os_is_linux_or_osx`) |
| `cache.mk` | File-based caching system with TTL support |
| `debug.mk` | Debug output utilities |
| `git.mk` | Git utilities (`mb_staged_files`, etc.) |
Expand Down Expand Up @@ -80,11 +80,11 @@ $(call mb_is_url,https://example.com)
```makefile
# Check operating system
$(if $(mb_os_is_linux),Linux-specific code)
$(if $(mb_os_is_mac),macOS-specific code)
$(if $(mb_os_is_windows),Windows-specific code)
$(if $(mb_os_is_osx),macOS-specific code)
$(if $(mb_os_is_linux_or_osx),Unix code)

# Run OS-specific command
$(call mb_os_call,windows_cmd,unix_cmd)
# Run OS-specific command (Linux vs macOS)
$(call mb_os_call,linux_cmd,mac_cmd)
```

### Caching
Expand Down
79 changes: 15 additions & 64 deletions core/functions.mk
Original file line number Diff line number Diff line change
Expand Up @@ -279,10 +279,9 @@ mb_ask_user_linux_mac_cmd ?= read -e

## @function mb_ask_user
## @desc Prompt user for input with optional timeout and default value
## @desc Cross-platform function (Linux/Mac/Windows). Note: timeout and default text don't work on Windows.
## @arg 1: question_text (optional) - Text to display (defaults to mb_ask_user_default_question_text)
## @arg 2: timeout (optional) - Timeout in seconds, 0 for no timeout (does not work on Windows)
## @arg 3: default_text (optional) - Default text pre-filled (does not work on Windows)
## @arg 2: timeout (optional) - Timeout in seconds, 0 for no timeout
## @arg 3: default_text (optional) - Default text pre-filled
## @example $(call mb_ask_user,Enter your name:)
## @example $(call mb_ask_user,Proceed?,10,y)
## @returns User input as string
Expand All @@ -293,84 +292,48 @@ $(strip
$(eval $0_question_text := $(if $(value 1),$1,$($0_default_question_text)))
$(eval $0_time_out := $(if $(value 2),-t $(strip $2)))
$(eval $0_default_text := $(if $(value 3),-i "$(strip $3)"))
$(call mb_os_call,$(call $0_windows),$(call $0_linux_mac))
$(mb_ask_user_linux_mac_cmd) \
-p "$($0_question_text)$(mb_space)" \
$($0_time_out) \
$($0_default_text) \
; \
echo $(mb_dollar_replace)REPLY
)
endef

## @function mb_ask_user_linux_mac
## @desc Linux/Mac implementation of user input prompt (uses bash read command)
## @desc Internal function called by mb_ask_user for Unix-based systems
## @returns User input from REPLY variable
## @group mb_ask_user
## @see mb_ask_user
define mb_ask_user_linux_mac
$(strip
$(mb_ask_user_linux_mac_cmd) \
-p "$(mb_ask_user_question_text)$(mb_space)" \
$(mb_ask_user_time_out) \
$(mb_ask_user_default_text) \
; \
echo $(mb_dollar_replace)REPLY \
)
endef


## NOTE: there is more that can be done to simulate the linux version (timeout and default text) but for now this is enough
mb_ask_user_windows = $(call mb_powershell,Read-Host "$(mb_ask_user_default_question_text)")


############################################################################################################################
############################################################################################################################

## @var mb_printf_info_format_specifier
## @desc Format string for info messages (OS-specific)
## @desc Format string for info messages
## @type string
## @group mb_printf
ifeq ($(OS),Windows_NT)
mb_printf_info_format_specifier ?= "{0}{1} {2}"
else
mb_printf_info_format_specifier ?= "%s$(call mb_colour_text,Green,%s)%b"
endif

## @var mb_printf_warn_format_specifier
## @desc Format string for warning messages (OS-specific)
## @desc Format string for warning messages
## @type string
## @group mb_printf
ifeq ($(OS),Windows_NT)
mb_printf_warn_format_specifier ?= "{0}{1} WARNING: {2}"
else
mb_printf_warn_format_specifier ?= "%s$(call mb_colour_text,IYellow,%sWARNING): %b"
endif

## @var mb_printf_error_format_specifier
## @desc Format string for error messages (OS-specific)
## @desc Format string for error messages
## @type string
## @group mb_printf
ifeq ($(OS),Windows_NT)
mb_printf_error_format_specifier ?= "{0}{1} ERROR: {2}"
else
mb_printf_error_format_specifier ?= "%s$(call mb_colour_text,BRed,%sERROR): %b"
endif

## @var mb_printf_debug_format_specifier
## @desc Format string for debug messages (OS-specific)
## @desc Format string for debug messages
## @type string
## @group mb_printf
ifeq ($(OS),Windows_NT)
mb_printf_debug_format_specifier ?= "{0}{1} DEBUG: {2}"
else
mb_printf_debug_format_specifier ?= "%s$(call mb_colour_text,BBlue,%sDEBUG): %b"
endif

## @var mb_printf_ts_format
## @desc Timestamp format for log messages (OS-specific)
## @desc Timestamp format for log messages
## @type string
## @group mb_printf
ifeq ($(OS),Windows_NT)
mb_printf_ts_format ?= "yyyy-MM-dd HH:mm:ss"
else
mb_printf_ts_format ?= +'%F %T'
endif

## @var mb_printf_opt_display_ts
## @desc Display timestamp in log messages
Expand Down Expand Up @@ -467,7 +430,6 @@ endif # MB_TARGETS_SKIP

mb_printf_statement_display_guard = $(strip $(mb_printf_opt_display_guard_l)$1$(mb_printf_opt_display_guard_r))## Prevent spaces

## NOTE: mb_os_assign not working so well for this
define mb_printf_statement
$(strip \
$(eval \
Expand All @@ -476,19 +438,8 @@ $(strip \
)\
)\
) \
$(if $(mb_os_is_windows), \
$(eval mb_printf_statement_ts := $(strip \
$(if $(call mb_is_on,$(mb_printf_opt_display_ts)),\
$(call mb_printf_statement_display_guard,$(shell $(call mb_powershell,Get-Date -Format $(mb_printf_ts_format))))\
) \
) \
) \
$(call mb_powershell,Write-Host ($(mb_printf_format) -f "$(mb_printf_statement_ts)"$(mb_comma)"$(mb_printf_statement_project_name)"$(mb_comma)"$(mb_printf_msg)"\
$(if $(mb_printf_breakline),,-NoNewline))) \
, \
$(eval mb_printf_statement_ts := $(if $(call mb_is_on,$(mb_printf_opt_display_ts)),$(call mb_printf_statement_display_guard,$(shell date $(mb_printf_ts_format))))) \
printf $(mb_printf_format) "$(mb_printf_statement_ts)" "$(mb_printf_statement_project_name)" "$(mb_printf_msg)"$(if $(mb_printf_breakline),;printf "\n") \
) \
$(eval mb_printf_statement_ts := $(if $(call mb_is_on,$(mb_printf_opt_display_ts)),$(call mb_printf_statement_display_guard,$(shell date $(mb_printf_ts_format))))) \
printf $(mb_printf_format) "$(mb_printf_statement_ts)" "$(mb_printf_statement_project_name)" "$(mb_printf_msg)"$(if $(mb_printf_breakline),;printf "\n") \
)
endef

Expand Down
11 changes: 1 addition & 10 deletions core/init_project.mk
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#####################################################################################
# Project: MakeBind
# File: core/util/init_project.mk
# File: core/init_project.mk
# Description: This provides a target that will setup the project to work with MakeBind
# Author: AntonioCS
# License: MIT License
Expand All @@ -12,20 +12,11 @@ mb_debug_init ?= $(mb_debug)

##NOTE: there are still error when calling mb_printf in some situations
### $(call mb_printf_info,Creating missing files)
ifeq ($(OS),Windows_NT)
## TODO: Remove Windows support - tracked in Trello ticket "Remove Windows support from MakeBind"
## NOTE: Windows paths need to be escaped even when SHELL is set to pwsh
mb_init_create_folder_cmd := $(call mb_powershell,mkdir $(subst /,\\,$(mb_project_bindhub_path)))
mb_init_cp_config_mk_cmd := $(call mb_powershell,copy $(subst /,\\,$(mb_makebind_templates_path)\\config.tpl.mk) $(subst /,\\,$(mb_project_config_file)))
mb_init_cp_project_mk_cmd := $(call mb_powershell,copy $(subst /,\\,$(mb_makebind_templates_path)\\project.tpl.mk) $(subst /,\\,$(mb_project_file)))

else
mb_init_create_folder_cmd := mkdir -p $(mb_project_bindhub_path)
mb_init_create_internal_folder_cmd := mkdir -p $(mb_project_bindhub_internal_path);
mb_init_cp_config_mk_cmd := cp $(mb_makebind_templates_path)/config.tpl.mk $(mb_project_config_file);
mb_init_cp_project_mk_cmd := cp $(mb_makebind_templates_path)/project.tpl.mk $(mb_project_file);
mb_init_cp_readme_cmd := cp $(mb_makebind_templates_path)/README.bind-hub.md $(mb_project_bindhub_path)/README.md;
endif

$(if $(call mb_not_exists,$(mb_project_bindhub_path)),\
$(call mb_debug_print,Creating bindhub path: $(mb_project_bindhub_path),$(mb_debug_init))\
Expand Down
12 changes: 0 additions & 12 deletions core/targets.mk
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,6 @@ mb_targets_all_desc_file ?= $(mb_core_util_bin_path)/target_listing/all_desc.gre

## https://marmelab.com/blog/2016/02/29/auto-documented-makefile.html
## This will list all the targets in the Makefile with their description
## Note: Having ifeq ($(mb_os_is_windows),1) was not working correctly
ifeq ($(if $(value OS),$(OS),not_windows),Windows_NT)
mb/targets-list:
powershell -Command "Select-String -Path $(subst $(mb_space),$(mb_comma),$(mb_targets_list_get_files_all)) -Pattern '^[\$$\(\)/a-zA-Z0-9_-]+:.*?## .*$$' -ErrorAction SilentlyContinue |\
ForEach-Object {\
$$parts = $$_.Line -split '##';\
$$formattedText = '{0,-40} {1}' -f $$parts[0].Trim().TrimEnd(':'), $$parts[1].Trim();\
Write-Host $$formattedText -ForegroundColor Cyan;\
}"
else
ifndef MB_TARGETS_SKIP

mb/targets-list: mb/targets-filtered
Expand Down Expand Up @@ -69,7 +59,6 @@ mb/targets-list:
;

endif # MB_TARGETS_SKIP
endif # Windows_NT


## Get the files to generate the list of make targets from
Expand Down Expand Up @@ -157,7 +146,6 @@ mb/help: ## Call help to get a list of available help keywords
$(call mb_printf_info, - $(subst mb_help_msg_,,$(mb_hmsg)))
)

## Note, might not display properly on windows
mb/help-%:
$(if $(value mb_help_msg_$*),
echo -e "$(mb_help_msg_$*)" | less -R
Expand Down
Loading