use make instead of meson for build
This commit is contained in:
parent
a79e2ca571
commit
041e836873
|
@ -2,6 +2,8 @@
|
|||
/build*
|
||||
/*.g1a
|
||||
/*.g3a
|
||||
*.o
|
||||
lzy
|
||||
|
||||
# Python bytecode
|
||||
__pycache__/
|
||||
|
|
|
@ -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
|
29
meson.build
29
meson.build
|
@ -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)
|
Loading…
Reference in New Issue