I/O optimizations, code refactor for better readability, pretty progress of extrction, output folder arg, -v -h args and overall improvements

This commit is contained in:
Rifat Azad 2024-09-16 16:55:38 +06:00
parent b1dc47344a
commit 6e4ace56aa
4 changed files with 226 additions and 106 deletions

View file

@ -1,21 +1,16 @@
#CFLAGS=-O3 -Wall
CFLAGS=-g -ggdb -Wall
#LDLIBS=-l
# Define compiler and flags
CC = gcc
all: pacextractor
# Target executable
TARGET = pacextractor
version.h:
if [ ! -f version.h ]; then \
if [ -d .git ]; then \
echo '#define VERSION_STR "$(shell git describe --tags --abbrev=0)"' > version.h; \
else \
echo '#define VERSION_STR ""' > version.h; \
fi \
fi
# Source files
SRC = pacextractor.c
pacextractor.o: version.h
# Rule to build the target
$(TARGET): $(SRC)
$(CC) $(SRC) -o $(TARGET)
# Clean up build artifacts
clean:
rm -f pacextractor *.o version.h
.PHONY: clean all
rm -f $(TARGET)