summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorpommicket <pommicket@gmail.com>2023-01-10 10:40:10 -0500
committerpommicket <pommicket@gmail.com>2023-01-10 10:40:10 -0500
commitb0fe15647d196081d801db574fa074ff77e46f5f (patch)
tree786d4b15493ab469811fc7cd139f5d664f414644 /Makefile
parentedd5188dfba93b8ffe376d0c194804f35f43dcaa (diff)
linux build , etc.
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile25
1 files changed, 11 insertions, 14 deletions
diff --git a/Makefile b/Makefile
index 836ea74..3ac6e41 100644
--- a/Makefile
+++ b/Makefile
@@ -2,7 +2,6 @@ ALL_CFLAGS=$(CFLAGS) -Wall -Wextra -Wshadow -Wconversion -Wpedantic -pedantic -s
-Wno-unused-function -Wno-fixed-enum-extension -Wimplicit-fallthrough -Wno-format-truncation -Wno-unknown-warning-option \
-Ipcre2
LIBS=-lSDL2 -lGL -lm libpcre2-32.a
-DEBUG_CFLAGS=$(ALL_CFLAGS) -Wno-unused-parameter -DDEBUG -O0 -g
RELEASE_CFLAGS=$(ALL_CFLAGS) -O3
PROFILE_CFLAGS=$(ALL_CFLAGS) -O3 -g -DPROFILE=1
# if you change the directories below, ted won't work.
@@ -10,21 +9,19 @@ PROFILE_CFLAGS=$(ALL_CFLAGS) -O3 -g -DPROFILE=1
GLOBAL_DATA_DIR=/usr/share/ted
LOCAL_DATA_DIR=/home/`logname`/.local/share/ted
INSTALL_BIN_DIR=/usr/bin
-OBJECTS=obj/buffer.o obj/build.o obj/colors.o obj/command.o\
- obj/config.o obj/find.o obj/gl.o obj/ide-autocomplete.o\
- obj/ide-definitions.o obj/ide-highlights.o obj/ide-hover.o\
- obj/ide-signature-help.o obj/ide-usages.o obj/lsp.o obj/lsp-json.o\
- obj/lsp-parse.o obj/lsp-write.o obj/main.o obj/menu.o obj/node.o\
- obj/os-posix.o obj/session.o obj/stb_image.o obj/stb_truetype.o\
- obj/syntax.o obj/tags.o obj/ted.o obj/text.o obj/ui.o obj/util.o
-ted: *.[ch] libpcre2-32.a $(OBJECTS)
- $(CC) $(OBJECTS) -o ted $(DEBUG_CFLAGS) $(LIBS)
-obj/stb_%.o: stb_%.c
- mkdir -p obj && $(CC) -O3 -Wall $< -c -o $@
-obj/%.o: %.c *.h
- mkdir -p obj && $(CC) -Wall $< -c -o $@ $(DEBUG_CFLAGS)
+debug-build: ted compile_commands.json
+ted: debug/ted
+ cp debug/ted .
+compile_commands.json: debug/compile_commands.json
+ cp debug/compile_commands.json .
+debug/ted: *.[ch] libpcre2-32.a CMakeLists.txt
+ mkdir -p debug
+ cd debug && cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=1 -DCMAKE_BUILD_TYPE=Debug ..
+ $(MAKE) -C debug
release: *.[ch] libpcre2-32.a
$(CC) main.c -o ted $(RELEASE_CFLAGS) $(LIBS)
+release_debug: *.[ch] libpcre2-32.a
+ $(CC) main.c -g -o ted $(RELEASE_CFLAGS) $(LIBS)
profile: *.[ch] libpcre2-32.a
$(CC) main.c -o ted $(PROFILE_CFLAGS) $(LIBS)
clean: