From a76bb43ec13f3b42234379469ea0f50683f2ebc7 Mon Sep 17 00:00:00 2001 From: a dinosaur Date: Wed, 2 Oct 2019 12:37:08 +1000 Subject: [PATCH] makefile builds objects into a build artifacts directory also forgot to commit the header --- neotools/.gitignore | 3 +++ neotools/neoadpcmextract.Makefile | 10 +++++++--- neotools/neoadpcmextract.h | 8 ++++++++ 3 files changed, 18 insertions(+), 3 deletions(-) create mode 100644 neotools/neoadpcmextract.h diff --git a/neotools/.gitignore b/neotools/.gitignore index d68123b..144b82f 100644 --- a/neotools/.gitignore +++ b/neotools/.gitignore @@ -5,7 +5,10 @@ *.pcm *.wav +*.obj_*/ *.o +*.d +CMakeLists.txt adpcm adpcmb neoadpcmextract diff --git a/neotools/neoadpcmextract.Makefile b/neotools/neoadpcmextract.Makefile index e6fe428..1249ee1 100644 --- a/neotools/neoadpcmextract.Makefile +++ b/neotools/neoadpcmextract.Makefile @@ -4,7 +4,8 @@ CFLAGS := -std=c99 -O2 -pipe -Wall -Wextra -pedantic LDFLAGS := $(CFLAGS) -OBJECT := $(SOURCE:%.c=%.o) +OBJDIR := .obj_$(TARGET) +OBJECT := $(patsubst %.c, $(OBJDIR)/%.o, $(SOURCE)) DEPEND := $(OBJECT:%.o=%.d) .PHONY: default all clean @@ -14,10 +15,13 @@ all: $(TARGET) $(TARGET): $(OBJECT) $(CC) $(LDFLAGS) $^ -o $@ -%.o: %.c +$(OBJDIR): + mkdir -p $@ + +$(OBJDIR)/%.o: %.c | $(OBJDIR) $(CC) $(CFLAGS) -MMD -c $< -o $@ -include: $(DEPEND) clean: - rm -f $(TARGET) $(OBJECT) $(DEPEND) + rm -rf $(OBJDIR) diff --git a/neotools/neoadpcmextract.h b/neotools/neoadpcmextract.h new file mode 100644 index 0000000..b55222f --- /dev/null +++ b/neotools/neoadpcmextract.h @@ -0,0 +1,8 @@ +#ifndef __NEOADPCMEXTRACT_H__ +#define __NEOADPCMEXTRACT_H__ + +#include + +int vgmExtractSamples(FILE* file); + +#endif//__NEOADPCMEXTRACT_H__