diff options
author | KikooDX <kikoodx@paranoici.org> | 2022-03-10 16:34:45 +0100 |
---|---|---|
committer | KikooDX <kikoodx@paranoici.org> | 2022-03-10 16:34:45 +0100 |
commit | 041e83687365cb2556411bb5e1170b59b8a17672 (patch) | |
tree | 242dc1c3a73d1321ffc7d4404f0f4398119852e3 | |
parent | a79e2ca571010fee26b1f027ba740de960ccfb7e (diff) | |
download | lzy-041e83687365cb2556411bb5e1170b59b8a17672.tar.gz |
use make instead of meson for build
-rw-r--r-- | .gitignore | 2 | ||||
-rw-r--r-- | Makefile | 32 | ||||
-rw-r--r-- | meson.build | 29 |
3 files changed, 34 insertions, 29 deletions
@@ -2,6 +2,8 @@ /build* /*.g1a /*.g3a +*.o +lzy # Python bytecode __pycache__/ diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..9569eb2 --- /dev/null +++ b/Makefile @@ -0,0 +1,32 @@ +CC ?= gcc +CFLAGS = -std=c99 -Wall -Wextra -O3 -I./inc $(shell sdl2-config --cflags) +LDFLAGS = -lSDL2 -lSDL2_image -lSDL2_mixer $(shell sdl2-config --libs) + +OBJ_NAME = lzy +OBJS := $(patsubst %.c,%.o,$(wildcard src/*.c)) + +all: $(OBJ_NAME) + +$(OBJ_NAME): $(OBJS) + $(CC) $(LDFLAGS) $(LIBRARIES) -o $(OBJ_NAME) $(OBJS) + strip $(OBJ_NAME) + +%.o: %.c + $(CC) $(CFLAGS) -c -o $@ $< + +cg: + fxsdk build-cg + +run: $(OBJ_NAME) + ./$(OBJ_NAME) + +format: + @clang-format -style=file -verbose -i src/*.c + @clang-format -style=file -verbose -i inc/*.h + +clean: + rm -f $(OBJ_NAME).g3a $(OBJ_NAME) + rm -f $(OBJS) + rm -Rf build-cg + +.PHONY: cg run run-txt format clean diff --git a/meson.build b/meson.build deleted file mode 100644 index 75ff221..0000000 --- a/meson.build +++ /dev/null @@ -1,29 +0,0 @@ -project('lzy', 'c') - -cc = meson.get_compiler('c') - -sdl2deps = [ - dependency('sdl2', version: '>=2.0.0'), - dependency('SDL2_image', version: '>=2.0.0'), - dependency('SDL2_mixer', version: '>=2.0.0'), - cc.find_library('m', required: true), - cc.find_library('dl', required: true), -] - -inc = include_directories('inc') - -sources = [ - 'src/main.c', -] - -c_flags = [ - '-std=c99', '-Os', - '-Wall', '-Wextra', -] - -executable('lzy', - sources, - include_directories : inc, - dependencies : sdl2deps, - install: false, - c_args : c_flags) |