This project is a simple C-based chat application that compiles and runs using gcc. It consists of several source files, and the build process is managed through a Makefile.
The project is organized into the following directories:
src/— Contains the source code (.cfiles) for the application.include/— Contains the header files (.hfiles) used in the project.build/— This is the directory where the compiled executable will be stored.
main.c— Entry point of the application.chats.c— Logic for handling chat-related functionality.messages.c— Logic for handling messages within the chat.
- A C compiler like
gccshould be installed on your system. makeutility should be installed.
-
Install Homebrew if you don't have it already:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" -
Install
makeusing Homebrew:brew install make
-
Update your package list:
sudo apt-get update
-
Install
make:sudo apt-get install build-essential
-
Install
makeusingdnf:sudo dnf install make
- Install Git for Windows, which includes
makeas part of the Git Bash environment. Download it from Git for Windows. - During installation, ensure that "Git Bash Here" and "Use Git from the Windows Command Prompt" options are selected.
-
Clone or download the project to your local machine.
-
Open a terminal and navigate to the project directory.
-
Run the following command to build and run the project:
make
This will compile the source files and run the resulting executable.
-
To clean up the build files, run:
make clean
The Makefile consists of several targets:
- all: Compiles the source files and builds the executable.
- run: Runs the executable after a successful build.
- clean: Removes the compiled executable.
Once the project is compiled and executed, the chat application will run. You can interact with it as per the features implemented in chats.c and messages.c