Initial Commit
This commit is contained in:
commit
f4fa723863
22 changed files with 1402 additions and 0 deletions
38
Makefile
Normal file
38
Makefile
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
CC ?= cc
|
||||
CSTD ?= -std=c11
|
||||
CFLAGS ?= -O2 -Wall -Wextra -Wpedantic $(CSTD)
|
||||
|
||||
SDL_CFLAGS := $(shell pkg-config --cflags SDL2 SDL2_ttf 2>/dev/null)
|
||||
SDL_LIBS := $(shell pkg-config --libs SDL2 SDL2_ttf 2>/dev/null)
|
||||
FFMPEG_CFLAGS := $(shell pkg-config --cflags libavformat libavcodec libswscale libavutil 2>/dev/null)
|
||||
FFMPEG_LIBS := $(shell pkg-config --libs libavformat libavcodec libswscale libavutil 2>/dev/null)
|
||||
MULTIARCH_CFLAGS := $(if $(wildcard /usr/include/i386-linux-gnu/SDL2/_real_SDL_config.h),-I/usr/include/i386-linux-gnu,)
|
||||
|
||||
ifeq ($(strip $(SDL_CFLAGS)),)
|
||||
SDL_CFLAGS := $(shell sdl2-config --cflags 2>/dev/null) $(MULTIARCH_CFLAGS)
|
||||
SDL_LIBS := $(shell sdl2-config --libs 2>/dev/null) -lSDL2_ttf
|
||||
endif
|
||||
|
||||
ifeq ($(strip $(FFMPEG_LIBS)),)
|
||||
FFMPEG_LIBS := -lavformat -lavcodec -lswscale -lavutil
|
||||
endif
|
||||
|
||||
SRC := $(wildcard src/*.c)
|
||||
OBJ := $(SRC:.c=.o)
|
||||
BIN := passport-c-media-player
|
||||
|
||||
CPPFLAGS += -I./src $(SDL_CFLAGS) $(FFMPEG_CFLAGS)
|
||||
LDLIBS += $(SDL_LIBS) $(FFMPEG_LIBS) -lm
|
||||
|
||||
.PHONY: all run clean
|
||||
|
||||
all: $(BIN)
|
||||
|
||||
$(BIN): $(OBJ)
|
||||
$(CC) $(OBJ) -o $@ $(LDLIBS)
|
||||
|
||||
run: $(BIN)
|
||||
./$(BIN)
|
||||
|
||||
clean:
|
||||
rm -f $(OBJ) $(BIN)
|
||||
Loading…
Add table
Add a link
Reference in a new issue