-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathMakefile
More file actions
72 lines (61 loc) · 2.18 KB
/
Makefile
File metadata and controls
72 lines (61 loc) · 2.18 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
61
62
63
64
65
66
67
68
69
70
71
72
CC = gcc
CFLAGS = -Wall -Wextra -std=c11 -O2 -Iinclude $(shell pkg-config --cflags ncurses)
LIBS = $(shell pkg-config --libs ncurses)
SRCS = src/core/main.c src/core/scanner.c \
src/ui/portpicker.c src/ui/configpanel.c src/ui/tui.c \
src/io/engine.c \
src/serial/port.c \
src/features/logger.c \
src/utils/ring_buffer.c\
src/features/autobaud.c
TARGET = ComScope
PREFIX = /usr/local
BINDIR = $(PREFIX)/bin
# Default target
all: $(TARGET)
# Build the application
$(TARGET): $(SRCS)
$(CC) $(CFLAGS) $^ -o $@ $(LIBS)
@echo "✓ Build successful: $(TARGET)"
# Install to system
install: $(TARGET)
@mkdir -p $(BINDIR)
install -m 755 $(TARGET) $(BINDIR)/$(TARGET)
@echo "✓ Installed to $(BINDIR)/$(TARGET)"
@echo "✓ Run with: ComScope"
# Uninstall from system
uninstall:
rm -f $(BINDIR)/$(TARGET)
@echo "✓ Uninstalled from $(BINDIR)/$(TARGET)"
# Clean build artifacts
clean:
rm -f $(TARGET)
rm -f *.o
@echo "✓ Cleaned build artifacts"
# Full clean (including generated files)
distclean: clean
@echo "✓ Full clean complete"
# Create release tarball
dist: distclean
@mkdir -p dist
tar czf dist/$(TARGET)-v1.0.0.tar.gz --exclude=.git --exclude=dist .
@echo "✓ Created dist/$(TARGET)-v1.0.0.tar.gz"
# Check if dependencies are installed
check-deps:
@which gcc > /dev/null || (echo "✗ gcc not found. Install with: sudo apt-get install build-essential" && exit 1)
@pkg-config --exists ncurses || (echo "✗ libncurses-dev not found. Install with: sudo apt-get install libncurses-dev" && exit 1)
@echo "✓ All dependencies found"
# Help target
help:
@echo "ComScope Makefile Targets:"
@echo ""
@echo " make - Build ComScope"
@echo " make install - Install to $(BINDIR)"
@echo " make uninstall - Remove from system"
@echo " make clean - Remove build artifacts"
@echo " make distclean - Remove build artifacts and generated files"
@echo " make dist - Create release tarball"
@echo " make check-deps - Check if dependencies are installed"
@echo " make help - Show this help message"
@echo ""
.PHONY: all install uninstall clean distclean dist check-deps help