summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlivier Gayot <olivier.gayot@sigexec.com>2023-02-11 21:26:49 +0100
committerOlivier Gayot <olivier.gayot@sigexec.com>2023-02-11 22:17:01 +0100
commitd63af637c42833b0f255a2e60bc609fd72d53f11 (patch)
treef2843609cc0c0d72cbff025e14bf92607ffcb23d
parent7300ea2d23e7315f7cadf1cbaaa74600c6f38142 (diff)
Replace Makefile by meson.build file
Signed-off-by: Olivier Gayot <olivier.gayot@sigexec.com>
-rw-r--r--Makefile61
-rw-r--r--meson.build28
2 files changed, 28 insertions, 61 deletions
diff --git a/Makefile b/Makefile
deleted file mode 100644
index 8b1e02d..0000000
--- a/Makefile
+++ /dev/null
@@ -1,61 +0,0 @@
-##
-## Makefile for in /home/gayot_o/prog/lib/sdl-digit
-##
-## Made by olivier gayot
-## Login <gayot_o@epitech.net>
-##
-## Started on Mon Apr 23 04:13:10 2012 olivier gayot
-## Last update Mon Apr 23 04:13:10 2012 olivier gayot
-##
-
-CC ?= gcc
-CFLAGS += -W -Wall -pedantic -std=c99 -Wextra -O3 `sdl-config --cflags`
-CFLAGS += -I./include
-HEADERS = include/sdl_digit.h
-LDFLAGS += `sdl-config --libs` -lm
-LDFLAGS += -L./lib
-SRC_DIR = src
-
-SRC = line.c \
- bar.c \
- rect.c \
- pixel.c \
- digit.c \
- string.c
-SRC := $(addprefix $(SRC_DIR)/, $(SRC))
-OBJ = $(SRC:.c=.o)
-NAME = libsdl-digit.a
-DEBUG = -g
-RENDU = -D PRAG
-
-all: $(NAME)
-
-$(NAME): $(OBJ)
- @echo 'Creating archive $(NAME)'
- @$(AR) $(ARFLAGS) $(NAME) $(OBJ)
- @echo 'done.'
- @echo 'Generating index for $(NAME)'
- @ranlib $(NAME)
- @echo 'done.'
-
-clean:
- @echo 'Cleaning obj files'
- @$(RM) $(OBJ)
- @echo 'done.'
-
-fclean: clean
- @echo 'Cleaning $(NAME)'
- @$(RM) $(NAME)
- @echo 'done'
-
-re: fclean all
-
-install:
- @echo '######## Installing $(basename $(NAME)) ########'
- install -D $(NAME) --target-directory=/usr/lib/
- install -D $(HEADERS) --target-directory=/usr/include/sdl-digit/
-
-debug: CFLAGS += $(DEBUG)
-debug: re
-
-.PHONY: all clean fclean re install debug
diff --git a/meson.build b/meson.build
new file mode 100644
index 0000000..bc6187a
--- /dev/null
+++ b/meson.build
@@ -0,0 +1,28 @@
+project('libsdl-digit', 'c')
+
+src_libsdl_digit = [
+ 'src/bar.c',
+ 'src/digit.c',
+ 'src/line.c',
+ 'src/pixel.c',
+ 'src/rect.c',
+ 'src/string.c',
+]
+
+pkgconfig = import('pkgconfig')
+dep_libsdl_digit = dependency('sdl')
+
+lib_libsdl_digit = library('sdl-digit', src_libsdl_digit,
+ include_directories: ['include'],
+ dependencies: dep_libsdl_digit,
+ version: '0.1',
+ install: true)
+
+install_headers('include/sdl_digit.h')
+
+pkgconfig.generate(
+ filebase: 'libsdl-digit',
+ name: 'LibSDL-digit',
+ description: 'SDL digits library',
+ version: meson.project_version(),
+ libraries: lib_libsdl_digit)