Skip to content

Conversation

@lkraider
Copy link

@lkraider lkraider commented Sep 10, 2025

This PR reorganizes the f3 project structure to prepare for future multi-platform support. All changes are purely structural - no functional modifications have been made to the core logic.

Motivation

The current flat directory structure makes it difficult to:

  • Distinguish between core utilities and platform-specific tools
  • Add new platform implementations without cluttering the root directory
  • Maintain clear separation of concerns as the project grows

Key Changes:

  • Directory Reorganization
    src/f3/ - Core utilities (f3read, f3write) and their shared libraries
    src/f3-extra/ - Platform-specific tools (f3probe, f3fix, f3brew) and their libraries
    include/f3/ - All header files consolidated for cleaner package structure
    scripts/ - Utility scripts moved to dedicated directory

  • Build System Updates
    Out-of-tree builds: All build artifacts now go into a build/ directory. This can help when cross-compiling and developing or building multiple architectures at once. Also useful for CI/CD to build multiple platforms in parallel.

Testing

  • make -n all shows correct compilation commands
  • make -n extra shows correct linking for platform-specific tools
  • No source code changes (only file moves)

This PR is a preparatory step for upcoming changes, particularly the introduction of platform-specific implementations. By separating concerns and establishing a clear hierarchy now, subsequent pull requests can focus on specific functionalities without being burdened by structural changes to the overall project structure.

@AltraMayor
Copy link
Owner

Could you update Section Files of the README file to reflect the new folder organization?

Copy link
Owner

@AltraMayor AltraMayor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update Makefile for out-of-tree build

extra: $(EXTRA_TARGETS)
# --- Output Directory Setup ---
BUILD_DIR := build
BIN_DIR := $(BUILD_DIR)/bin
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new binaries' location breaks the GitHub workflow. Please update the workflow file .github/workflows/test.yml.

$(UNLINK) $(DESTDIR)$(PREFIX)/share/man/man1/f3write.1

uninstall-extra:
cd $(DESTDIR)$(PREFIX)/bin ; rm $(EXTRA_TARGETS)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After the changes, have you tested the targets uninstall and uninstall-extra?

Copy link
Owner

@AltraMayor AltraMayor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move files to new folder structure

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right now, libflow.c is only used in f3write and f3read, but the goal is to eventually use it in f3brew as well. See my comment here for more context. With this proposed change, how could libflow.c be shared between f3 and f3-extra?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants