make a test ffmpeg

This commit is contained in:
William Bell
2025-12-27 21:18:41 +00:00
parent d2c4bd3f08
commit 65a5a1ee15
2 changed files with 221 additions and 8 deletions

28
Makefile Normal file
View File

@@ -0,0 +1,28 @@
CC := gcc
TARGET := player
SRC_DIR := src
BUILD := build
SRCS := $(wildcard $(SRC_DIR)/*.c)
OBJS := $(patsubst $(SRC_DIR)/%.c,$(BUILD)/%.o,$(SRCS))
CFLAGS := -Wall -Wextra -O3
CFLAGS += $(shell pkg-config --cflags libavformat libavcodec libavutil libswresample alsa)
LDFLAGS := $(shell pkg-config --libs libavformat libavcodec libavutil libswresample alsa)
all: $(TARGET)
$(TARGET): $(OBJS)
$(CC) -o $@ $^ $(LDFLAGS)
$(BUILD)/%.o: $(SRC_DIR)/%.c | $(BUILD)
$(CC) $(CFLAGS) -c $< -o $@
$(BUILD):
mkdir -p $(BUILD)
clean:
rm -rf $(BUILD) $(TARGET)
.PHONY: all clean