Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Makefile: Initialise Makefile #11

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
CC := gcc
CFLAGS := -g -o
ALL_CFLAGS := -I. $(CFLAGS)


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

SRC_PLAYER := main_window.cpp decoder.cpp
SRC_TCP_PLAYER := tcp_main_window.cpp decoder.cpp tcp_client.c
SRC_TCP_SERVER := tcp_server.c
SRC_TRANSCODER := transcoder.c debug.c

$(shell mkdir -p $(TARGET_DIR))

.PHONY: all

all: player tcp_player tcp_server transcoder
Comment on lines +14 to +18
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Better than this would be to check if the target_dir is present or not in all. If it is not present create one and move forward. If it is present move forward.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well I quite didn't understand you, did you mean putting target_dir as a pre requisite for all and add the mkdir as a recipe for the all. If that's what you meant, make player won't create the directory.


player:
$(CC) $(SRC_PLAYER) $(LIBS) $(ALL_CFLAGS) $(TARGET_DIR)$@

tcp_server:
$(CC) $(SRC_TCP_SERVER) $(CFLAGS) $(TARGET_DIR)$@

tcp_player:
$(CC) $(SRC_TCP_PLAYER) $(LIBS) $(ALL_CFLAGS) $(TARGET_DIR)$@

transcoder:
$(CC) $(SRC_TRANSCODER) $(LIBS) $(ALL_CFLAGS) $(TARGET_DIR)$@

clean:
@rm -rf $(TARGET_DIR)

print-% : ; @echo $* = $($*)