-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
38 lines (26 loc) · 681 Bytes
/
Makefile
File metadata and controls
38 lines (26 loc) · 681 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
# Compiler
CC = gcc
# Compiler flags
CFLAGS = -Wall -Wextra -Werror # -std=c11
# Source files
SRCS = ./src/main.c ./src/midi.c ./src/fcb.c ./src/ui_ncurses.c ./src/fcb_io.c
# Object files
OBJS = $(SRCS:./src/%.c=./build/obj/%.o)
# Output executable
TARGET = ./build/bin/fcbtool
# Default target
all: $(TARGET)
# Rule to build the target executable
$(TARGET): $(OBJS)
$(CC) $(CFLAGS) -o $(TARGET) $(OBJS) -lasound -lncurses
# Rule to compile source files into object files
./build/obj/%.o: ./src/%.c
$(CC) $(CFLAGS) -c $< -o $@
# Clean up build artifacts
clean:
rm -f $(OBJS) $(TARGET)
# Run target
run: $(TARGET)
./$(TARGET)
debug: clean all run
.PHONY: all clean