-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile.linux
More file actions
60 lines (48 loc) · 1.74 KB
/
Makefile.linux
File metadata and controls
60 lines (48 loc) · 1.74 KB
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# Voice to Text - Linux Makefile
# Builds the Linux C implementation with GTK3 + AppIndicator
CC = gcc
CFLAGS = -Wall -Wextra -O2 -pthread
CFLAGS += $(shell pkg-config --cflags portaudio-2.0)
CFLAGS += $(shell pkg-config --cflags x11 xtst xext)
CFLAGS += $(shell pkg-config --cflags gtk+-3.0)
CFLAGS += $(shell pkg-config --cflags ayatana-appindicator3-0.1)
CFLAGS += $(shell pkg-config --cflags libnotify)
LDFLAGS = -pthread -lm
LDFLAGS += $(shell pkg-config --libs portaudio-2.0)
LDFLAGS += $(shell pkg-config --libs x11 xtst xext)
LDFLAGS += $(shell pkg-config --libs gtk+-3.0)
LDFLAGS += $(shell pkg-config --libs ayatana-appindicator3-0.1)
LDFLAGS += $(shell pkg-config --libs libnotify)
TARGET = vtt-linux
SRC_DIR = src
BUILD_DIR = build
# Source files
COMMON_SRCS = $(SRC_DIR)/common/logging.c $(SRC_DIR)/common/queue.c $(SRC_DIR)/common/settings.c
LINUX_SRCS = $(SRC_DIR)/linux/audio.c \
$(SRC_DIR)/linux/keyboard.c \
$(SRC_DIR)/linux/typing.c \
$(SRC_DIR)/linux/transcribe.c \
$(SRC_DIR)/linux/gui.c \
$(SRC_DIR)/linux/main.c
SRCS = $(COMMON_SRCS) $(LINUX_SRCS)
OBJS = $(SRCS:$(SRC_DIR)/%.c=$(BUILD_DIR)/%.o)
.PHONY: all clean install
all: $(TARGET)
$(TARGET): $(OBJS)
@echo "Linking $(TARGET)..."
$(CC) $(OBJS) $(LDFLAGS) -o $(TARGET)
@echo "Build complete: $(TARGET)"
$(BUILD_DIR)/%.o: $(SRC_DIR)/%.c
@mkdir -p $(dir $@)
@echo "Compiling $<..."
$(CC) $(CFLAGS) -c $< -o $@
clean:
@echo "Cleaning build artifacts..."
rm -rf $(BUILD_DIR) $(TARGET)
install: $(TARGET)
@echo "Installing $(TARGET) to /usr/local/bin..."
sudo install -m 755 $(TARGET) /usr/local/bin/
sudo install -m 755 src/common/transcribe.py /usr/local/bin/
@echo "Installation complete"
run: $(TARGET)
./$(TARGET)