-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
24 lines (19 loc) · 725 Bytes
/
Makefile
File metadata and controls
24 lines (19 loc) · 725 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
CXX=gcc
CFLAGS=-Wall -Wextra -std=c11 -pedantic -ggdb `pkg-config --cflags gl glew glfw3 freetype2`
LDLIBS=-lm `pkg-config --libs gl glew glfw3 freetype2`
TARGET=myte
SRCS=$(addprefix src/, main.c application.c renderer.c util.c font.c gapbuffer.c editor.c lexer.c toml.c config.c browser.c keys.c cursor.c dialog.c)
OBJ=$(patsubst src/%.c, build/%.o, $(SRCS))
all: clean build $(TARGET)
# Link the object files into the final executable
$(TARGET): $(OBJ)
$(CXX) $(CFLAGS) -o $@ $(OBJ) $(LDLIBS)
# Compile each source file into an object file in the build directory
build/%.o: src/%.c
$(CXX) $(CFLAGS) -c $< -o $@
# Create the build directory if it doesn't exist
build:
mkdir -p build
# Clean up
clean:
rm -rf build