Skip to content

Commit

Permalink
Makefile: Initialise Makefile
Browse files Browse the repository at this point in the history
This commit does
- Initialise makefile and uses targets to be made
- Separate variables for source files, directories and common compiler
  • Loading branch information
iammarco11 committed Aug 18, 2020
1 parent 98e5f6b commit 3b7803b
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
CC := gcc

LIBS := -lstdc++ -lavcodec -lavformat -lavutil -lswresample -lswscale -lglfw -lGL
TARGET_DIR := bin/

SRC_FILES_PLAYER := main_window.cpp decoder.cpp
SRC_FILES_TCP_PLAYER := tcp_main_window.cpp decoder.cpp tcp_client.c
SRC_FILES_TCP_SERVER := tcp_server.c
SRC_FILES_TRANSCODER := transcoder.c debug.c

.PHONY: all

all: dir player tcp_player tcp_server transcoder

dir:
if [ ! -d "$(TARGET_DIR)" ]; then \
mkdir -p $(TARGET_DIR); \
fi

player:
$(CC) $(SRC_FILES_PLAYER) $(LIBS) -o $(TARGET_DIR)$@

tcp_server:
$(CC) $(SRC_FILES_TCP_SERVER) -o $(TARGET_DIR)$@

tcp_player:
$(CC) $(SRC_FILES_TCP_PLAYER) $(LIBS) -o $(TARGET_DIR)$@

transcoder:
$(CC) $(SRC_FILES_TRANSCODER) $(LIBS) -o $(TARGET_DIR)$@

0 comments on commit 3b7803b

Please sign in to comment.