WIP: working on libide (makefile)

This commit is contained in:
Jean Sirmai 2023-11-23 11:27:17 +01:00
parent 1ad7c1eabb
commit 1d6ca0b8f7
Signed by: jean
GPG Key ID: FB3115C340E057E3
24 changed files with 77 additions and 142 deletions

View File

@ -43,17 +43,23 @@ CC=gcc
WARNINGS= -Wall WARNINGS= -Wall
DEBUG= -ggdb -fno-omit-frame-pointer -fdiagnostics-color=always DEBUG= -ggdb -fno-omit-frame-pointer -fdiagnostics-color=always
OPTIMIZE= -O3 OPTIMIZE= -O3
INCLUDE= $(shell pkg-config --cflags glib-2.0 libxml-2.0 gtk4) INCLUDE= $(shell pkg-config --cflags glib-2.0 libxml-2.0 gtk4) -I libide/core
LIBS= $(shell pkg-config --libs glib-2.0 libxml-2.0 gtk4) -lGL -lGLU -lm -lepoxy -lX11 -lGLEW LIBS= $(shell pkg-config --libs glib-2.0 libxml-2.0 gtk4) -lGL -lGLU -lm -lepoxy -lX11 -lGLEW
BINDIR=bin BINDIR=bin
BUILDDIR=build BUILDDIR=build
SRCDIR=src SRCDIR=src
LIBIDEDIR=libide
#vpath %.c $(SRCDIR) #vpath %.c $(SRCDIR)
SOURCES= $(shell find $(SRCDIR) -type f -name "*.c") SOURCES=$(shell find $(SRCDIR) -type f -name "*.c")
LIBIDESOURCES=$(shell find $(LIBIDEDIR) -type f -name "*.c")
LIBIDESOURCES=$(LIBIDESOURCES) $(shell find $(LIBIDEDIR) -type f -name "*.in")
BUILDBINS=$(patsubst %.c,$(BUILDDIR)/%.o,$(SOURCES)) BUILDBINS=$(patsubst %.c,$(BUILDDIR)/%.o,$(SOURCES))
BUILDDEPS=$(patsubst %.c,$(BUILDDIR)/%.d,$(SOURCES)) BUILDDEPS=$(patsubst %.c,$(BUILDDIR)/%.d,$(SOURCES))
LIBIDEBUILDBINS=$(patsubst %.c,$(LIBIDEDIR)/%.o,$(SOURCES))
LIBIDEBUILDDEPS=$(patsubst %.c,$(LIBIDEDIR)/%.d,$(SOURCES))
-include /etc/os-release -include /etc/os-release
@ -64,6 +70,10 @@ $(BUILDDIR):
@mkdir -p $@ @mkdir -p $@
@echo -e ${CL2}[$@] ${CL}folder generated.${CL3} @echo -e ${CL2}[$@] ${CL}folder generated.${CL3}
$(LIBIDEDIR):
@mkdir -p $@
@echo -e ${CL2}[$@] ${CL}folder generated.${CL3}
$(BINDIR): $(BINDIR):
@mkdir -p $@ @mkdir -p $@
@echo -e ${CL2}[$@] ${CL}folder generated.${CL3} @echo -e ${CL2}[$@] ${CL}folder generated.${CL3}
@ -71,17 +81,25 @@ $(BINDIR):
# #
# Dependencies # Dependencies
# #
-include $(LIBIDEBUILDDEPS)
-include $(BUILDDEPS) -include $(BUILDDEPS)
$(BUILDDIR)/%.d: %.c | $(BUILDDIR) $(BUILDDIR)/%.d: %.c | $(BUILDDIR)
@mkdir -p $(shell dirname $@) @mkdir -p $(shell dirname $@)
@$(CC) -MM -MT $(@:%.d=%.o) -MF $@ $< @$(CC) $(INCLUDE) -MM -MT $(@:%.d=%.o) -MF $@ $<
@echo -e ${CL2}[$@] ${CL}dependencies generated.${CL3}
$(LIBIDEDIR)/%.d: %.c | $(LIBIDEDIR)
@mkdir -p $(shell dirname $@)
@$(CC) $(INCLUDE) -MM -MT $(@:%.d=%.o) -MF $@ $<
@echo -e ${CL2}[$@] ${CL}dependencies generated.${CL3} @echo -e ${CL2}[$@] ${CL}dependencies generated.${CL3}
# #
# Compilation # Compilation
# #
$(BINDIR)/gem-graph-client: $(BUILDBINS) | $(BINDIR) $(BINDIR)/gem-graph-client: $(LIBIDEBUILDBINS) $(BUILDBINS) | $(BINDIR)
@$(CC) -o $@ $(WARNINGS) $(DEBUG) $(OPTIMIZE) $^ $(INCLUDE) $(LIBS) @$(CC) -o $@ $(WARNINGS) $(DEBUG) $(OPTIMIZE) $^ $(INCLUDE) $(LIBS)
@echo -e ${CL2}[$@] ${CL}built.${CL3} @echo -e ${CL2}[$@] ${CL}built.${CL3}
@ -91,6 +109,10 @@ $(BUILDDIR)/%.o: %.c | $(BUILDDIR)
@$(CC) $(WARNINGS) $(DEBUG) $(OPTIMIZE) $(INCLUDE) -c $< -o $@ @$(CC) $(WARNINGS) $(DEBUG) $(OPTIMIZE) $(INCLUDE) -c $< -o $@
@echo -e ${CL2}[$@] ${CL}compiled.${CL3} @echo -e ${CL2}[$@] ${CL}compiled.${CL3}
$(LIBIDEDIR)/%.o: %.c | $(LIBIDEDIR)
@mkdir -p $(shell dirname $@)
@$(CC) $(WARNINGS) $(DEBUG) $(OPTIMIZE) $(INCLUDE) -c $< -o $@
@echo -e ${CL2}[$@] ${CL}compiled.${CL3}
# #
# Virtual recipes # Virtual recipes

View File

@ -104,7 +104,7 @@ G_BEGIN_DECLS
*/ */
#ifndef IDE_ENABLE_TRACE #ifndef IDE_ENABLE_TRACE
# define IDE_ENABLE_TRACE @ENABLE_TRACING@ # define IDE_ENABLE_TRACE 0
#endif #endif
#if IDE_ENABLE_TRACE != 1 #if IDE_ENABLE_TRACE != 1
# undef IDE_ENABLE_TRACE # undef IDE_ENABLE_TRACE

View File

@ -244,3 +244,4 @@
#else #else
# define IDE_AVAILABLE_IN_42 _IDE_EXTERN # define IDE_AVAILABLE_IN_42 _IDE_EXTERN
#endif #endif

View File

@ -37,7 +37,7 @@
* *
* The build type of the installed build. * The build type of the installed build.
*/ */
#define IDE_BUILD_TYPE @BUILD_TYPE@ #define IDE_BUILD_TYPE Gem-graph
/** /**
* IDE_BUILD_CHANNEL: * IDE_BUILD_CHANNEL:
@ -45,28 +45,28 @@
* The release channel of Builder. This should be a string such as * The release channel of Builder. This should be a string such as
* "other", "flatpak-stable", or "flatpak-nightly". * "other", "flatpak-stable", or "flatpak-nightly".
*/ */
#define IDE_BUILD_CHANNEL @BUILD_CHANNEL@ #define IDE_BUILD_CHANNEL other
/** /**
* IDE_MAJOR_VERSION: * IDE_MAJOR_VERSION:
* *
* libide major version component (e.g. 1 if %IDE_VERSION is 1.2.3) * libide major version component (e.g. 1 if %IDE_VERSION is 1.2.3)
*/ */
#define IDE_MAJOR_VERSION (@MAJOR_VERSION@) #define IDE_MAJOR_VERSION (42)
/** /**
* IDE_MINOR_VERSION: * IDE_MINOR_VERSION:
* *
* libide minor version component (e.g. 2 if %IDE_VERSION is 1.2.3) * libide minor version component (e.g. 2 if %IDE_VERSION is 1.2.3)
*/ */
#define IDE_MINOR_VERSION (@MINOR_VERSION@) #define IDE_MINOR_VERSION (1)
/** /**
* IDE_VERSION * IDE_VERSION
* *
* libide version. * libide version.
*/ */
#define IDE_VERSION (@VERSION@) #define IDE_VERSION (42.1)
/** /**
* IDE_VERSION_S: * IDE_VERSION_S:
@ -74,7 +74,7 @@
* libide version, encoded as a string, useful for printing and * libide version, encoded as a string, useful for printing and
* concatenation. * concatenation.
*/ */
#define IDE_VERSION_S "@VERSION@" #define IDE_VERSION_S "42.1"
#define IDE_ENCODE_VERSION(major,minor,micro) \ #define IDE_ENCODE_VERSION(major,minor,micro) \
((major) << 24 | (minor) << 16 | (micro) << 8) ((major) << 24 | (minor) << 16 | (micro) << 8)

View File

@ -1,129 +0,0 @@
libide_core_header_dir = join_paths(libide_header_dir, 'core')
libide_core_header_subdir = join_paths(libide_header_subdir, 'core')
libide_include_directories += include_directories('.')
#
# Versioning that all libide libraries (re)use
#
version_data = configuration_data()
version_data.set('MAJOR_VERSION', MAJOR_VERSION)
version_data.set('MINOR_VERSION', MINOR_VERSION)
version_data.set('VERSION', meson.project_version())
version_data.set_quoted('BUILD_CHANNEL', get_option('channel'))
version_data.set_quoted('BUILD_TYPE', get_option('buildtype'))
libide_core_version_h = configure_file(
input: 'ide-version.h.in',
output: 'ide-version.h',
install_dir: libide_core_header_dir,
install: true,
configuration: version_data)
libide_core_generated_headers = [libide_core_version_h]
libide_build_ident_h = vcs_tag(
command: ['git', 'describe'],
fallback: meson.project_version(),
input: 'ide-build-ident.h.in',
output: 'ide-build-ident.h',
)
libide_core_generated_headers += [libide_build_ident_h]
#
# Debugging and Tracing Support
#
libide_core_conf = configuration_data()
libide_core_conf.set10('ENABLE_TRACING', get_option('tracing'))
libide_core_conf.set('BUGREPORT_URL', 'https://gitlab.gnome.org/GNOME/gnome-builder/issues')
libide_debug_h = configure_file(
input: 'ide-debug.h.in',
output: 'ide-debug.h',
configuration: libide_core_conf,
install: true,
install_dir: libide_core_header_dir,
)
libide_core_generated_headers += [libide_debug_h]
#
# Public API Headers
#
libide_core_public_headers = [
'ide-context.h',
'ide-context-addin.h',
'ide-global.h',
'ide-log.h',
'ide-macros.h',
'ide-notification.h',
'ide-notifications.h',
'ide-object.h',
'ide-object-box.h',
'ide-settings.h',
'ide-transfer.h',
'ide-transfer-manager.h',
'ide-version-macros.h',
'libide-core.h',
]
libide_core_private_headers = [
'ide-transfer-manager-private.h',
]
install_headers(libide_core_public_headers, subdir: libide_core_header_subdir)
#
# Sources
#
libide_core_public_sources = [
'ide-context.c',
'ide-context-addin.c',
'ide-global.c',
'ide-log.c',
'ide-notification.c',
'ide-notifications.c',
'ide-object.c',
'ide-object-box.c',
'ide-object-notify.c',
'ide-settings.c',
'ide-transfer.c',
'ide-transfer-manager.c',
]
libide_core_sources = []
libide_core_sources += libide_core_generated_headers
libide_core_sources += libide_core_public_sources
#
# Library Definitions
#
libide_core_deps = [
libgio_dep,
libgtk_dep,
libdazzle_dep,
libpeas_dep,
]
libide_core = static_library('ide-core-' + libide_api_version, libide_core_sources,
dependencies: libide_core_deps,
c_args: libide_args + release_args + ['-DIDE_CORE_COMPILATION'],
)
libide_core_dep = declare_dependency(
sources: libide_core_private_headers + libide_core_generated_headers,
dependencies: libide_core_deps,
link_with: libide_core,
include_directories: include_directories('.'),
)
gnome_builder_public_sources += files(libide_core_public_sources)
gnome_builder_public_headers += files(libide_core_public_headers)
gnome_builder_private_headers += files(libide_core_private_headers)
gnome_builder_generated_headers += libide_core_generated_headers
gnome_builder_include_subdirs += libide_core_header_subdir
gnome_builder_gir_extra_args += ['--c-include=libide-core.h', '-DIDE_CORE_COMPILATION']

View File

@ -0,0 +1,2 @@
libide/src/graphics/arrows.o: src/graphics/arrows.c \
src/graphics/../../include/base.h src/graphics/../../include/graphics.h

Binary file not shown.

View File

@ -0,0 +1,4 @@
libide/src/graphics/graphics.o: src/graphics/graphics.c \
src/graphics/../../include/base.h src/graphics/../../include/ui.h \
src/graphics/../../include/graphics.h \
src/graphics/../../include/arrows.h src/graphics/../../include/grid.h

Binary file not shown.

View File

@ -0,0 +1,2 @@
libide/src/graphics/grid.o: src/graphics/grid.c \
src/graphics/../../include/base.h src/graphics/../../include/graphics.h

BIN
libide/src/graphics/grid.o Normal file

Binary file not shown.

1
libide/src/main.d Normal file
View File

@ -0,0 +1 @@
libide/src/main.o: src/main.c src/../include/base.h src/../include/ui.h

BIN
libide/src/main.o Normal file

Binary file not shown.

View File

@ -0,0 +1 @@
libide/src/parsing/parsing.o: src/parsing/parsing.c

Binary file not shown.

View File

@ -0,0 +1,2 @@
libide/src/ui/application.o: src/ui/application.c \
src/ui/../../include/base.h src/ui/../../include/ui.h

BIN
libide/src/ui/application.o Normal file

Binary file not shown.

2
libide/src/ui/events.d Normal file
View File

@ -0,0 +1,2 @@
libide/src/ui/events.o: src/ui/events.c src/ui/../../include/base.h \
src/ui/../../include/graphics.h src/ui/../../include/ui.h

BIN
libide/src/ui/events.o Normal file

Binary file not shown.

25
libide/src/ui/tree.d Normal file
View File

@ -0,0 +1,25 @@
libide/src/ui/tree.o: src/ui/tree.c \
/gnu/store/w45prki9fmydxyx6sixnkcbrpfz56a1g-glib-2.72.3/include/glib-2.0/glib.h \
src/ui/../../include/base.h src/ui/../../include/ui.h \
src/ui/../../libide/tree/libide-tree.h \
/gnu/store/xzgdf1mww3yjgdbd24bz98fdf9i8pqq0-gtk-4.8.1/include/gtk-4.0/gtk/gtk.h \
src/ui/../../libide/tree/ide-tree.h \
src/ui/../../libide/tree/../core/libide-core.h \
src/ui/../../libide/tree/../core/ide-context.h \
src/ui/../../libide/tree/../core/ide-object.h \
src/ui/../../libide/tree/../core/ide-version-macros.h \
src/ui/../../libide/tree/../core/ide-version.h \
src/ui/../../libide/tree/../core/ide-context-addin.h \
src/ui/../../libide/tree/../core/ide-debug.h \
src/ui/../../libide/tree/../core/ide-global.h \
src/ui/../../libide/tree/../core/ide-log.h \
src/ui/../../libide/tree/../core/ide-macros.h \
src/ui/../../libide/tree/../core/ide-notification.h \
src/ui/../../libide/tree/../core/ide-notifications.h \
src/ui/../../libide/tree/../core/ide-object-box.h \
src/ui/../../libide/tree/../core/ide-settings.h \
src/ui/../../libide/tree/../core/ide-transfer.h \
src/ui/../../libide/tree/../core/ide-transfer-manager.h \
src/ui/../../libide/tree/ide-tree-node.h \
src/ui/../../libide/tree/ide-tree-addin.h \
src/ui/../../libide/tree/ide-tree-model.h

2
libide/src/ui/window.d Normal file
View File

@ -0,0 +1,2 @@
libide/src/ui/window.o: src/ui/window.c src/ui/../../include/base.h \
src/ui/../../include/ui.h

BIN
libide/src/ui/window.o Normal file

Binary file not shown.

View File

@ -21,7 +21,7 @@
#pragma once #pragma once
#include <gtk/gtk.h> #include <gtk/gtk.h>
#include </home/jean/Gem-Graph/gem-graph-client/libide/core/libide-core.h> #include "../core/libide-core.h"
#include "ide-tree-node.h" #include "ide-tree-node.h"

View File

@ -27,7 +27,7 @@
#include "../../include/base.h" #include "../../include/base.h"
#include "../../include/ui.h" #include "../../include/ui.h"
//#include "/home/jean/Gem-Graph/gem-graph-client/libide/tree/libide-tree.h" #include "../../libide/tree/libide-tree.h"
void Hello(void) void Hello(void)
{ {