convert project to use meson

This commit is contained in:
clayton craft
2021-09-22 18:06:13 +00:00
committed by Johannes Marbach
parent 08f255cefe
commit 5f9470121e
4 changed files with 168 additions and 53 deletions

1
.gitignore vendored
View File

@@ -1,3 +1,4 @@
*.o
unl0kr
fbkb
/_build

View File

@@ -1,51 +0,0 @@
# Copyright 2021 Johannes Marbach
#
# This file is part of unl0kr, hereafter referred to as the program.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
CC ?= gcc
LVGL_DIR_NAME ?= lvgl
LVGL_DIR ?= ${shell pwd}
CFLAGS ?= -O3 -g0 -I$(LVGL_DIR)/ -Wall -Wshadow -Wundef -Wmissing-prototypes -Wno-discarded-qualifiers -Wall -Wextra -Wno-unused-function -Wno-error=strict-prototypes -Wpointer-arith -fno-strict-aliasing -Wno-error=cpp -Wuninitialized -Wmaybe-uninitialized -Wno-unused-parameter -Wno-missing-field-initializers -Wtype-limits -Wsizeof-pointer-memaccess -Wno-format-nonliteral -Wno-cast-qual -Wunreachable-code -Wno-switch-default -Wreturn-type -Wmultichar -Wformat-security -Wno-ignored-qualifiers -Wno-error=pedantic -Wno-sign-compare -Wno-error=missing-prototypes -Wdouble-promotion -Wclobbered -Wdeprecated -Wempty-body -Wtype-limits -Wshift-negative-value -Wstack-usage=2048 -Wno-unused-value -Wno-unused-parameter -Wno-missing-field-initializers -Wuninitialized -Wmaybe-uninitialized -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wtype-limits -Wsizeof-pointer-memaccess -Wno-format-nonliteral -Wpointer-arith -Wno-cast-qual -Wmissing-prototypes -Wunreachable-code -Wno-switch-default -Wreturn-type -Wmultichar -Wno-discarded-qualifiers -Wformat-security -Wno-ignored-qualifiers -Wno-sign-compare
LDFLAGS ?= -lm -linput -lxkbcommon
BIN = unl0kr
MAINSRC = ./cursor.c ./main.c ./libinput_multi.c ./libinput_xkb.c ./montserrat_extended_32.c ./sq2lv_layouts.c ./squeek2lvgl/sq2lv.c
include $(LVGL_DIR)/lvgl/lvgl.mk
include $(LVGL_DIR)/lv_drivers/lv_drivers.mk
OBJEXT ?= .o
AOBJS = $(ASRCS:.S=$(OBJEXT))
COBJS = $(CSRCS:.c=$(OBJEXT))
MAINOBJ = $(MAINSRC:.c=$(OBJEXT))
SRCS = $(ASRCS) $(CSRCS) $(MAINSRC)
OBJS = $(AOBJS) $(COBJS)
all: default
%.o: %.c
@$(CC) $(CFLAGS) -c $< -o $@
@echo "CC $<"
default: $(AOBJS) $(COBJS) $(MAINOBJ)
$(CC) -o $(BIN) $(MAINOBJ) $(AOBJS) $(COBJS) $(LDFLAGS)
clean:
rm -f $(BIN) $(AOBJS) $(COBJS) $(MAINOBJ)

View File

@@ -69,9 +69,12 @@ Below is a summary of contributions upstreamed thus far.
For development and testing you can run the app in a VT. Unless your user account has special privileges, `sudo` will be needed to access input device files.
```
$ make
$ meson _build
$ meson compile -C build
# with meson <0.55, use ninja directly:
$ ninja -C _build
$ sudo chvt 2
$ sudo ./unl0kr
$ sudo ./_build/unl0kr
```
## Fonts

162
meson.build Normal file
View File

@@ -0,0 +1,162 @@
project(
'unl0kr',
'c',
version : '0.0',
default_options : ['warning_level=0'],
meson_version : '>=0.53.0',
)
unl0kr_sources = [
'cursor.c',
'main.c',
'libinput_multi.c',
'libinput_xkb.c',
'montserrat_extended_32.c',
'sq2lv_layouts.c',
]
squeek2lvgl_sources = [
'squeek2lvgl/sq2lv.c',
]
lvgl_sources = [
'lvgl/src/core/lv_disp.c',
'lvgl/src/core/lv_event.c',
'lvgl/src/core/lv_group.c',
'lvgl/src/core/lv_indev.c',
'lvgl/src/core/lv_indev_scroll.c',
'lvgl/src/core/lv_obj.c',
'lvgl/src/core/lv_obj_class.c',
'lvgl/src/core/lv_obj_draw.c',
'lvgl/src/core/lv_obj_pos.c',
'lvgl/src/core/lv_obj_scroll.c',
'lvgl/src/core/lv_obj_style.c',
'lvgl/src/core/lv_obj_style_gen.c',
'lvgl/src/core/lv_obj_tree.c',
'lvgl/src/core/lv_refr.c',
'lvgl/src/core/lv_theme.c',
'lvgl/src/draw/lv_draw_arc.c',
'lvgl/src/draw/lv_draw_blend.c',
'lvgl/src/draw/lv_draw_img.c',
'lvgl/src/draw/lv_draw_label.c',
'lvgl/src/draw/lv_draw_line.c',
'lvgl/src/draw/lv_draw_mask.c',
'lvgl/src/draw/lv_draw_rect.c',
'lvgl/src/draw/lv_draw_triangle.c',
'lvgl/src/draw/lv_img_buf.c',
'lvgl/src/draw/lv_img_cache.c',
'lvgl/src/draw/lv_img_decoder.c',
'lvgl/src/extra/layouts/flex/lv_flex.c',
'lvgl/src/extra/layouts/grid/lv_grid.c',
'lvgl/src/extra/lv_extra.c',
'lvgl/src/extra/others/snapshot/lv_snapshot.c',
'lvgl/src/extra/themes/basic/lv_theme_basic.c',
'lvgl/src/extra/themes/default/lv_theme_default.c',
'lvgl/src/extra/themes/mono/lv_theme_mono.c',
'lvgl/src/extra/widgets/animimg/lv_animimg.c',
'lvgl/src/extra/widgets/calendar/lv_calendar.c',
'lvgl/src/extra/widgets/calendar/lv_calendar_header_arrow.c',
'lvgl/src/extra/widgets/calendar/lv_calendar_header_dropdown.c',
'lvgl/src/extra/widgets/chart/lv_chart.c',
'lvgl/src/extra/widgets/colorwheel/lv_colorwheel.c',
'lvgl/src/extra/widgets/imgbtn/lv_imgbtn.c',
'lvgl/src/extra/widgets/keyboard/lv_keyboard.c',
'lvgl/src/extra/widgets/led/lv_led.c',
'lvgl/src/extra/widgets/list/lv_list.c',
'lvgl/src/extra/widgets/meter/lv_meter.c',
'lvgl/src/extra/widgets/msgbox/lv_msgbox.c',
'lvgl/src/extra/widgets/span/lv_span.c',
'lvgl/src/extra/widgets/spinbox/lv_spinbox.c',
'lvgl/src/extra/widgets/spinner/lv_spinner.c',
'lvgl/src/extra/widgets/tabview/lv_tabview.c',
'lvgl/src/extra/widgets/tileview/lv_tileview.c',
'lvgl/src/extra/widgets/win/lv_win.c',
'lvgl/src/font/lv_font.c',
'lvgl/src/font/lv_font_dejavu_16_persian_hebrew.c',
'lvgl/src/font/lv_font_fmt_txt.c',
'lvgl/src/font/lv_font_loader.c',
'lvgl/src/font/lv_font_montserrat_10.c',
'lvgl/src/font/lv_font_montserrat_12.c',
'lvgl/src/font/lv_font_montserrat_12_subpx.c',
'lvgl/src/font/lv_font_montserrat_14.c',
'lvgl/src/font/lv_font_montserrat_16.c',
'lvgl/src/font/lv_font_montserrat_18.c',
'lvgl/src/font/lv_font_montserrat_20.c',
'lvgl/src/font/lv_font_montserrat_22.c',
'lvgl/src/font/lv_font_montserrat_24.c',
'lvgl/src/font/lv_font_montserrat_26.c',
'lvgl/src/font/lv_font_montserrat_28.c',
'lvgl/src/font/lv_font_montserrat_28_compressed.c',
'lvgl/src/font/lv_font_montserrat_30.c',
'lvgl/src/font/lv_font_montserrat_32.c',
'lvgl/src/font/lv_font_montserrat_34.c',
'lvgl/src/font/lv_font_montserrat_36.c',
'lvgl/src/font/lv_font_montserrat_38.c',
'lvgl/src/font/lv_font_montserrat_40.c',
'lvgl/src/font/lv_font_montserrat_42.c',
'lvgl/src/font/lv_font_montserrat_44.c',
'lvgl/src/font/lv_font_montserrat_46.c',
'lvgl/src/font/lv_font_montserrat_48.c',
'lvgl/src/font/lv_font_montserrat_8.c',
'lvgl/src/font/lv_font_simsun_16_cjk.c',
'lvgl/src/font/lv_font_unscii_16.c',
'lvgl/src/font/lv_font_unscii_8.c',
'lvgl/src/hal/lv_hal_disp.c',
'lvgl/src/hal/lv_hal_indev.c',
'lvgl/src/hal/lv_hal_tick.c',
'lvgl/src/misc/lv_anim.c',
'lvgl/src/misc/lv_anim_timeline.c',
'lvgl/src/misc/lv_area.c',
'lvgl/src/misc/lv_async.c',
'lvgl/src/misc/lv_bidi.c',
'lvgl/src/misc/lv_color.c',
'lvgl/src/misc/lv_fs.c',
'lvgl/src/misc/lv_gc.c',
'lvgl/src/misc/lv_ll.c',
'lvgl/src/misc/lv_log.c',
'lvgl/src/misc/lv_math.c',
'lvgl/src/misc/lv_mem.c',
'lvgl/src/misc/lv_printf.c',
'lvgl/src/misc/lv_style.c',
'lvgl/src/misc/lv_style_gen.c',
'lvgl/src/misc/lv_templ.c',
'lvgl/src/misc/lv_timer.c',
'lvgl/src/misc/lv_tlsf.c',
'lvgl/src/misc/lv_txt.c',
'lvgl/src/misc/lv_txt_ap.c',
'lvgl/src/misc/lv_utils.c',
'lvgl/src/widgets/lv_arc.c',
'lvgl/src/widgets/lv_bar.c',
'lvgl/src/widgets/lv_btn.c',
'lvgl/src/widgets/lv_btnmatrix.c',
'lvgl/src/widgets/lv_canvas.c',
'lvgl/src/widgets/lv_checkbox.c',
'lvgl/src/widgets/lv_dropdown.c',
'lvgl/src/widgets/lv_img.c',
'lvgl/src/widgets/lv_label.c',
'lvgl/src/widgets/lv_line.c',
'lvgl/src/widgets/lv_objx_templ.c',
'lvgl/src/widgets/lv_roller.c',
'lvgl/src/widgets/lv_slider.c',
'lvgl/src/widgets/lv_switch.c',
'lvgl/src/widgets/lv_table.c',
'lvgl/src/widgets/lv_textarea.c',
'lv_drivers/display/drm.c',
'lv_drivers/display/fbdev.c',
'lv_drivers/gtkdrv/gtkdrv.c',
'lv_drivers/indev/evdev.c',
'lv_drivers/indev/libinput.c',
'lv_drivers/indev/xkb.c',
]
executable(
'unl0kr',
sources : lvgl_sources + squeek2lvgl_sources + unl0kr_sources,
include_directories : ['lvgl', 'lv_drivers'],
dependencies : [
dependency('xkbcommon'),
dependency('libinput'),
],
c_args : ['-Wno-error=pedantic']
)