move code files to src/, move to meson build system

This commit is contained in:
Stefan Bühler 2021-09-15 16:58:28 +02:00
parent eb78414668
commit 7e9fbaf5d2
26 changed files with 75 additions and 76 deletions

View File

@ -1,41 +0,0 @@
DBG = -g
CC = gcc
WARNFLAGS = -Wall -Wmissing-declarations -Wdeclaration-after-statement -Wcast-align -Winline -Wsign-compare -Wnested-externs -Wpointer-arith -Wformat-security
override CFLAGS += -D_REENTRANT $(shell sdl-config --cflags) $(DBG) $(WARNFLAGS)
.PHONY: all clean install
all: sdlbomber
sdlbomber: announce.o bomber.o draw.o game.o gfx.o sound.o list.o network.o menu.o utils.o
gcc $(LDFLAGS) -o $@ $^ $(shell sdl-config --libs) -lavahi-common -lavahi-client $(DBG)
matcher: matcher.c
announce.o: announce.c announce.h network.h
bomber.o: bomber.c announce.h bomber.h draw.h game.h gfx.h list.h menu.h network.h sound.h utils.h
draw.o: draw.c draw.h bomber.h gfx.h
game.o: game.c announce.h bomber.h draw.h game.h gfx.h list.h menu.h network.h sound.h utils.h
gfx.o: gfx.c gfx.h bomber.h
list.o: list.c bomber.h list.h utils.h
menu.o: menu.c announce.h bomber.h draw.h game.h gfx.h list.h menu.h network.h sound.h utils.h
network.o: network.c announce.h bomber.h draw.h game.h menu.h network.h utils.h
sound.o: sound.c sound.h
utils.o: utils.c bomber.h utils.h gfx.h
clean:
rm -f *.o matcher sdlbomber
install: sdlbomber
echo "Installing into $(DESTDIR)"
mkdir -p "$(DESTDIR)/usr/bin/" "$(DESTDIR)/usr/share/sdlbomber/"
install -m 0755 sdlbomber "$(DESTDIR)/usr/bin/"
install -m 0644 data/*.pcx data/*.raw "$(DESTDIR)/usr/share/sdlbomber/"

View File

@ -1,26 +0,0 @@
#DBG += -g
#DBG += -pg
CC = gcc
CFLAGS = -O2 -Wall -I/Library/Frameworks/SDL.framework/Headers $(DBG)
LDFLAGS += -framework SDL -framework Cocoa -o $@ -lavahi-client
all: sdlbomber
sdlbomber: gfx.o bomber.o sound.o SDLMain.o announce.o
SDLMain.o: SDLmain.m
bomber.o: bomber.c bomber.h gfx.h sound.h announce.h
gfx.o: gfx.c bomber.h gfx.h
sound.o: sound.c bomber.h sound.h
announce.o: announce.c announce.h
clean:
rm -f *.o sdlbomber matcher
test: all
./sdlbomber

View File

@ -1,9 +0,0 @@
# Makefile for bomber
#
TARGET = sdlbomber
USEINET = true
include ../GNUmake
$(TARGET): bomber.o gfx.o sound.o announce.o

75
meson.build Normal file
View File

@ -0,0 +1,75 @@
project(
'sdlbomber',
'c',
version: '1.0.10',
default_options: [
'warning_level=3',
'buildtype=debugoptimized',
],
)
avahi_client_dep = dependency(
'avahi-client',
)
sdl_dep = dependency(
'sdl',
)
executable(
'sdlbomber',
'src/announce.c',
'src/bomber.c',
'src/draw.c',
'src/game.c',
'src/gfx.c',
'src/list.c',
# 'src/matcher.c',
'src/menu.c',
'src/network.c',
'src/sound.c',
'src/utils.c',
# override_options: [
# 'c_std=c11',
# ],
install: true,
dependencies: [
avahi_client_dep,
sdl_dep,
]
)
install_data(
'data/bigfont.pcx',
'data/blocks1.pcx',
'data/blocks1x.pcx',
'data/blocks2.pcx',
'data/blocks2x.pcx',
'data/blocks3.pcx',
'data/blocks3x.pcx',
'data/bomb1.pcx',
'data/bomb1.raw',
'data/bomb2.pcx',
'data/bomb2.raw',
'data/death.raw',
'data/death1.pcx',
'data/death2.pcx',
'data/death3.pcx',
'data/drop.raw',
'data/field0.pcx',
'data/flames.pcx',
'data/font.pcx',
'data/pal0.pcx',
'data/pal1.pcx',
'data/pal2.pcx',
'data/pal3.pcx',
'data/pal4.pcx',
'data/pal5.pcx',
'data/pal6.pcx',
'data/pal7.pcx',
'data/pal8.pcx',
'data/pal9.pcx',
'data/power1.raw',
'data/power2.raw',
'data/tiles.pcx',
'data/walk.pcx',
)

View File

View File

View File

View File

View File

View File

View File

View File

View File

View File