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
93 changes: 93 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
name: Build and test

on:
push:
branches:
- develop
- main
- master
pull_request:

jobs:
ubuntu:
name: Ubuntu build
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
autoconf \
automake \
build-essential \
lsb-release \
libncurses-dev \
ntfs-3g \
ntfs-3g-dev

- name: Bootstrap
run: ./autogen.sh

- name: Configure
run: ./configure

- name: Build
run: make

- name: Test
run: make check

- name: Test fragmented NTFS image
run: sudo ./TestSuite/Create\ Fragmented\ Volumes/ci_fragmented_volume_test.sh ./udefrag

- name: Upload binary
uses: actions/upload-artifact@v4
with:
name: udefrag-linux
path: udefrag
if-no-files-found: error

cachyos:
name: CachyOS build
runs-on: ubuntu-latest
container:
image: cachyos/cachyos:latest

steps:
- name: Install dependencies
run: |
pacman -Syu --noconfirm
pacman -S --noconfirm --needed \
autoconf \
automake \
base-devel \
grep \
ncurses \
ntfs-3g

- name: Checkout
uses: actions/checkout@v4

- name: Bootstrap
run: ./autogen.sh

- name: Configure
run: ./configure

- name: Build
run: make

- name: Test
run: make check

- name: Upload binary
uses: actions/upload-artifact@v4
with:
name: udefrag-cachyos
path: udefrag
if-no-files-found: error

117 changes: 114 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,61 @@
# Created by https://www.gitignore.io/api/c,c++,linux,macos,windows
# Edit at https://www.gitignore.io/?templates=c,c++,linux,macos,windows
# Created by https://www.toptal.com/developers/gitignore/api/c,c++,linux,macos,windows,git,autotools,visualstudiocode
# Edit at https://www.toptal.com/developers/gitignore?templates=c,c++,linux,macos,windows,git,autotools,visualstudiocode

### Autotools ###
# http://www.gnu.org/software/automake

Makefile.in
/ar-lib
/mdate-sh
/py-compile
/test-driver
/ylwrap
.deps/
.dirstamp

# http://www.gnu.org/software/autoconf

autom4te.cache
/autoscan.log
/autoscan-*.log
/aclocal.m4
/compile
/config.cache
/config.guess
/config.h.in
/config.log
/config.status
/config.sub
/configure
/configure.scan
/depcomp
/install-sh
/missing
/stamp-h1

# https://www.gnu.org/software/libtool/

/ltmain.sh

# http://www.gnu.org/software/texinfo

/texinfo.tex

# http://www.gnu.org/software/m4/

m4/libtool.m4
m4/ltoptions.m4
m4/ltsugar.m4
m4/ltversion.m4
m4/lt~obsolete.m4

# Generated Makefile
# (meta build system like autotools,
# can automatically generate from config.status script
# (which is called by configure script))
Makefile

### Autotools Patch ###

### C ###
# Prerequisites
Expand Down Expand Up @@ -74,6 +130,21 @@ dkms.conf

# Executables

### Git ###
# Created by git for backups. To disable backups in Git:
# $ git config --global mergetool.keepBackup false
*.orig

# Created by git when using merge tools for conflicts
*.BACKUP.*
*.BASE.*
*.LOCAL.*
*.REMOTE.*
*_BACKUP_*.txt
*_BASE_*.txt
*_LOCAL_*.txt
*_REMOTE_*.txt

### Linux ###
*~

Expand All @@ -98,6 +169,7 @@ dkms.conf
# Icon must end with two \r
Icon


# Thumbnails
._*

Expand All @@ -117,6 +189,29 @@ Network Trash Folder
Temporary Items
.apdisk

### macOS Patch ###
# iCloud generated files
*.icloud

### VisualStudioCode ###
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
!.vscode/*.code-snippets

# Local History for Visual Studio Code
.history/

# Built Visual Studio Code Extensions
*.vsix

### VisualStudioCode Patch ###
# Ignore all local history of files
.history
.ionide

### Windows ###
# Windows thumbnail cache files
Thumbs.db
Expand All @@ -143,8 +238,24 @@ $RECYCLE.BIN/
# Windows shortcuts
*.lnk

# End of https://www.gitignore.io/api/c,c++,linux,macos,windows
# End of https://www.toptal.com/developers/gitignore/api/c,c++,linux,macos,windows,git,autotools,visualstudiocode


.git
udefrag

# Autotools generated files
/autotools-config.h
/autotools-config.h.in
/ultradefrag4linux-*/
/ultradefrag4linux-*.tar.*
/.deps/
**/.deps/

# Legacy Windows/MinGW build helpers and generated files
/ci/bin/
Makefile.mingw
Makefile_x64.mingw
/src/console/getopt.c
/src/console/getopt.h
/src/console/getopt1.c
80 changes: 80 additions & 0 deletions Makefile.am
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
AUTOMAKE_OPTIONS = foreign subdir-objects

AM_CPPFLAGS = \
-DLXGC=1 \
$(NTFS3G_CFLAGS) \
-I$(top_srcdir)/src/include \
-I$(top_srcdir)/src/console \
-I$(top_srcdir)/src/dll/udefrag \
-I$(top_srcdir)/src/dll/zenwinx \
-I$(top_srcdir)/src/wincalls

bin_PROGRAMS = udefrag

noinst_HEADERS = \
src/console/udefrag.h \
src/include/compiler.h \
src/include/extrawin.h \
src/include/linux.h \
src/include/ultradfgver.h \
src/include/version.h \
src/share/getopt.h \
src/dll/udefrag/udefrag.h \
src/dll/udefrag/udefrag-internals.h \
src/dll/zenwinx/myendians.h \
src/dll/zenwinx/mytypes.h \
src/dll/zenwinx/ntndk.h \
src/dll/zenwinx/ntfs.h \
src/dll/zenwinx/partition.h \
src/dll/zenwinx/prb.h \
src/dll/zenwinx/zenwinx.h \
src/dll/zenwinx/zenwinxver.h \
src/wincalls/ntfs-3g.h

EXTRA_DIST = autogen.sh

udefrag_SOURCES = \
src/console/defrag.c \
src/console/map.c \
src/console/options.c \
src/dll/udefrag/analyze.c \
src/dll/udefrag/defrag.c \
src/dll/udefrag/map.c \
src/dll/udefrag/move.c \
src/dll/udefrag/optimize.c \
src/dll/udefrag/options.c \
src/dll/udefrag/reports.c \
src/dll/udefrag/search.c \
src/dll/udefrag/tasks.c \
src/dll/udefrag/udefrag.c \
src/dll/udefrag/volume.c \
src/dll/zenwinx/dbg.c \
src/dll/zenwinx/env.c \
src/dll/zenwinx/event.c \
src/dll/zenwinx/file.c \
src/dll/zenwinx/ftw.c \
src/dll/zenwinx/ftw_ntfs.c \
src/dll/zenwinx/ldr.c \
src/dll/zenwinx/list.c \
src/dll/zenwinx/lock.c \
src/dll/zenwinx/mem.c \
src/dll/zenwinx/misc.c \
src/dll/zenwinx/path.c \
src/dll/zenwinx/prb.c \
src/dll/zenwinx/string.c \
src/dll/zenwinx/thread.c \
src/dll/zenwinx/time.c \
src/dll/zenwinx/volume.c \
src/dll/zenwinx/zenwinx.c \
src/wincalls/wincalls.c \
src/wincalls/ntfs-3g.c \
src/wincalls/curses.c

udefrag_LDADD = \
$(NTFS3G_LIBS) \
$(PTHREAD_LIBS) \
$(CURSES_LIBS) \
-lm

check-local: udefrag
./udefrag --help | $(GREP) -q "Usage: udefrag"
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,10 @@ The results at the time were clear, no changes just a GUI on top.
## Compiling

```sh
cd src
CFLAGS='-Wno-implict-function-declaration' make
./autogen.sh
./configure
make
make check
```

## Support
Expand Down
Loading
Loading