-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
41 lines (29 loc) · 956 Bytes
/
Makefile
File metadata and controls
41 lines (29 loc) · 956 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
CC = gcc
CFLAGS = -Wall -Wextra
LIBS = -lpthread -lportaudio -lssl -lcrypto
NCURSES = -lncurses
UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S),Darwin)
PORTAUDIO_CFLAGS = -I/opt/homebrew/include
PORTAUDIO_LIBS = -L/opt/homebrew/lib
else
PORTAUDIO_CFLAGS =
PORTAUDIO_LIBS =
endif
OBJS = client.o text_chat.o audio_chat.o tui.o
all: client server
client: $(OBJS)
$(CC) $(CFLAGS) $(PORTAUDIO_CFLAGS) -o client $(OBJS) $(PORTAUDIO_LIBS) $(LIBS) $(NCURSES)
server: server.o
$(CC) $(CFLAGS) -o server server.o $(LIBS)
%.o: %.c
$(CC) $(CFLAGS) $(PORTAUDIO_CFLAGS) -c $< -o $@
clean:
rm -f *.o client server
check_deps:
@echo "Checking dependencies..."
@which portaudio-config > /dev/null || echo "Missing: PortAudio"
@which pkg-config > /dev/null || echo "Missing: pkg-config"
@pkg-config --exists ncurses || echo "Missing: ncurses"
certs:
openssl req -x509 -newkey rsa:2048 -keyout server.key -out server.crt -days 365 -nodes