1
0
mirror of https://github.com/ScrelliCopter/VGM-Tools synced 2025-02-21 04:09:25 +11:00

neotools: fuck it, we CMake now

This commit is contained in:
2020-05-26 10:29:57 +10:00
parent 08b61568e1
commit 6456404bd3
5 changed files with 21 additions and 83 deletions

10
neotools/.gitignore vendored
View File

@@ -5,10 +5,6 @@
*.pcm
*.wav
*.obj_*/
*.o
*.d
CMakeLists.txt
adpcm
adpcmb
neoadpcmextract
.idea/
build/
cmake-build-*/

18
neotools/CMakeLists.txt Normal file
View File

@@ -0,0 +1,18 @@
project(neoadpcmtools)
cmake_minimum_required(VERSION "3.1" FATAL_ERROR)
add_executable(adpcm adpcm.c)
target_compile_options(adpcm PRIVATE
-fomit-frame-pointer -Werror -Wall
-W -Wno-sign-compare -Wno-unused
-Wpointer-arith -Wbad-function-cast -Wcast-align -Waggregate-return
-pedantic
-Wshadow
-Wstrict-prototypes)
target_link_libraries(adpcm m)
add_executable(adpcmb adpcmb.c)
add_executable(neoadpcmextract autoextract.c neoadpcmextract.c)
set_property(TARGET neoadpcmextract PROPERTY C_STANDARD 99)
target_compile_options(neoadpcmextract PRIVATE -Wall -Wextra -pedantic)

View File

@@ -1,34 +0,0 @@
# Standard makefile to use as a base for DJGPP projects (not anymore lol)
# By MARTINEZ Fabrice aka SNK of SUPREMACY
# Programs to use during make
LD := $(CC)
TARGET := adpcm
SOURCE := adpcm.c
# Flags for compilation
CFLAGS := -fomit-frame-pointer -O3 -Werror -Wall \
-W -Wno-sign-compare -Wno-unused \
-Wpointer-arith -Wbad-function-cast -Wcast-align -Waggregate-return \
-pedantic \
-Wshadow \
-Wstrict-prototypes
LDFLAGS := -lm
# Object files
OBJECT := $(SOURCE:%.c=%.o)
# Make rules
all: $(TARGET)
$(TARGET): $(OBJECT)
$(LD) $(CFLAGS) $(LDFLAGS) $^ -o $@
%.o: %.c
$(CC) $(CFLAGS) -c $< -o $@
# Rules to manage files
.PHONY: clean
clean:
rm -f $(TARGET) $(OBJECT)

View File

@@ -1,15 +0,0 @@
CC = gcc
CFLAGS = -O3
SRC = .
OBJ = .
OUT_OBJ = $(OBJ)/adpcmb
all: $(OUT_OBJ)
$(OBJ)/%.exe: $(SRC)/%.c
$(CC) $(CCFLAGS) $(MAINFLAGS) $< -o $@
clean:
rm $(OUT_OBJ)

View File

@@ -1,27 +0,0 @@
TARGET := neoadpcmextract
SOURCE := autoextract.c neoadpcmextract.c
CFLAGS := -std=c99 -O2 -pipe -Wall -Wextra -pedantic
LDFLAGS := $(CFLAGS)
OBJDIR := .obj_$(TARGET)
OBJECT := $(patsubst %.c, $(OBJDIR)/%.o, $(SOURCE))
DEPEND := $(OBJECT:%.o=%.d)
.PHONY: default all clean
default: $(TARGET)
all: $(TARGET)
$(TARGET): $(OBJECT)
$(CC) $(LDFLAGS) $^ -o $@
$(OBJDIR):
mkdir -p $@
$(OBJDIR)/%.o: %.c | $(OBJDIR)
$(CC) $(CFLAGS) -MMD -c $< -o $@
-include: $(DEPEND)
clean:
rm -rf $(OBJDIR)