Skip to content

Simplify Makefile with intuitive targets and evaluate rcm dependency #46

@xtetsuji

Description

@xtetsuji

Problem

The current Makefile implementation has become complex and scattered, making it difficult to use for everyday dotfiles management. The current targets are not intuitive for common use cases, and the dependency on rcm adds unnecessary complexity for what could be simple symlink operations.

Current Issues

Complex Target Structure

  • Multiple shellcheck targets that could be unified
  • Verbose target names that don't match common usage patterns
  • Mixed concerns (symlink management, validation, status checking)

rcm Dependency Questions

  • Do we really need rcm? For basic symlink creation, native shell commands might suffice
  • rcm installation becomes a barrier on some systems (Alpine Linux, minimal environments)
  • Most operations could be simplified to basic ln -sf commands

Poor User Experience

  • Users need to remember complex target names
  • No clear workflow for common scenarios
  • Status checking and installation are separate concerns

Proposed Solution

1. Simplify to Essential Use Cases

Primary workflows:

make install    # Install/update all dotfiles  
make status     # Show current status
make clean      # Remove broken symlinks
make check      # Run all validations

Optional workflows:

make uninstall  # Remove all managed symlinks
make backup     # Backup existing files before install

2. Evaluate rcm Necessity

Current rcm usage:

  • Symlink creation with rcup
  • Exclusion handling via rcrc

Alternative without rcm:

  • Simple ln -sf for each dotfile
  • Handle exclusions in Makefile logic
  • Reduce external dependencies

Decision criteria:

  • If rcm only provides symlink creation → Remove it
  • If rcm provides unique value → Keep but make optional

3. Unified Target Design

# Main workflow targets
install: backup-if-needed create-symlinks
status: check-symlinks show-status  
clean: remove-broken-symlinks
check: shellcheck validate-configs

# Implementation targets (hidden from usage)
backup-if-needed:
create-symlinks:
check-symlinks:
show-status:
remove-broken-symlinks:
shellcheck:
validate-configs:

4. Simplified Usage Model

Daily usage:

# First time setup
make install

# Regular maintenance  
make status
make clean

# After changes
make check
make install

Benefits

  • Reduced complexity: Fewer, more intuitive targets
  • Better workflow: Matches actual usage patterns
  • Reduced dependencies: Potentially eliminate rcm requirement
  • Faster adoption: Simpler commands for new users
  • Maintenance: Easier to understand and modify

Implementation Strategy

  1. Phase 1: Analyze current rcm usage and benefits
  2. Phase 2: Design new target structure
  3. Phase 3: Implement rcm-free alternative (if beneficial)
  4. Phase 4: Add advanced features (backup, validation)
  5. Phase 5: Update documentation and remove old targets

Questions to Resolve

  • rcm value assessment: What unique features does rcm provide?
  • Backup strategy: How to handle existing files safely?
  • Cross-platform: Ensure compatibility across macOS/Linux
  • Migration path: How to transition from current system?

Success Criteria

  • Common workflows require ≤2 commands
  • No external dependencies (or optional rcm)
  • Clear, memorable target names
  • Robust error handling and rollback
  • Maintains all current functionality

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions