nice refactors, now way cleaner to work with!

This commit is contained in:
2026-04-07 17:20:42 +02:00
parent 966c15cffb
commit bdc58f5b48
17 changed files with 61 additions and 31 deletions

View File

@@ -1,16 +1,35 @@
# Makefile
CC = gcc
CFLAGS = -Wall -O2
CFLAGS = -Wall -O2 -Iinclude -Ithird_party
LDFLAGS = -lm
SRCDIR = src
BUILDDIR = build
TARGET = e36
TARGET = e36
SRCS = main.c sstv.c robot36.c image.c wav.c martin.c scottie.c
OBJS = $(SRCS:.c=.o)
SRCS = \
$(SRCDIR)/main.c \
$(SRCDIR)/encoder/image.c \
$(SRCDIR)/encoder/sstv.c \
$(SRCDIR)/encoder/modes/martin.c \
$(SRCDIR)/encoder/modes/robot36.c \
$(SRCDIR)/encoder/modes/scottie.c \
$(SRCDIR)/sound/wav.c
OBJS = $(patsubst $(SRCDIR)/%.c,$(BUILDDIR)/%.o,$(SRCS))
.PHONY: all clean dirs
all: dirs $(TARGET)
dirs:
mkdir -p $(BUILDDIR)/encoder/modes $(BUILDDIR)/sound
$(TARGET): $(OBJS)
$(CC) $(OBJS) -o $(TARGET) $(LDFLAGS)
$(CC) $(OBJS) -o $@ $(LDFLAGS)
%.o: %.c
$(BUILDDIR)/%.o: $(SRCDIR)/%.c
$(CC) $(CFLAGS) -c $< -o $@
clean:
rm -f $(TARGET) $(OBJS)
rm -rf $(BUILDDIR) $(TARGET)