nice refactors, now way cleaner to work with!
This commit is contained in:
33
Makefile
33
Makefile
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user