diff --git a/libretro-common/file/nbio/Makefile b/libretro-common/file/nbio/test/Makefile similarity index 57% rename from libretro-common/file/nbio/Makefile rename to libretro-common/file/nbio/test/Makefile index 39f1c51092..ae15877388 100644 --- a/libretro-common/file/nbio/Makefile +++ b/libretro-common/file/nbio/test/Makefile @@ -1,9 +1,14 @@ TARGET := nbio_test -SOURCES := $(wildcard *.c) +LIBRETRO_COMM_DIR := ../../.. + +SOURCES := \ + nbio_test.c \ + ../nbio_stdio.c + OBJS := $(SOURCES:.c=.o) -CFLAGS += -Wall -pedantic -std=gnu99 -O0 -g -I../../include +CFLAGS += -Wall -pedantic -std=gnu99 -g -I$(LIBRETRO_COMM_DIR)/include all: $(TARGET) diff --git a/libretro-common/file/nbio/nbio_test.c b/libretro-common/file/nbio/test/nbio_test.c similarity index 100% rename from libretro-common/file/nbio/nbio_test.c rename to libretro-common/file/nbio/test/nbio_test.c diff --git a/libretro-common/formats/png/Makefile b/libretro-common/formats/png/Makefile deleted file mode 100644 index 2fbc79dd3b..0000000000 --- a/libretro-common/formats/png/Makefile +++ /dev/null @@ -1,38 +0,0 @@ -TARGET := rpng -HAVE_IMLIB2=1 - -LDFLAGS += -lz - -ifeq ($(HAVE_IMLIB2),1) -CFLAGS += -DHAVE_IMLIB2 -LDFLAGS += -lImlib2 -endif - -SOURCES_C := rpng.c \ - rpng_encode.c \ - rpng_test.c \ - ../../compat/compat_strl.c \ - ../../file/nbio/nbio_stdio.c \ - ../../file/file_archive.c \ - ../../file/file_archive_zlib.c \ - ../../file/file_path.c \ - ../../file/retro_file.c \ - ../../string/string_list.c - -OBJS := $(SOURCES_C:.c=.o) - -CFLAGS += -Wall -pedantic -std=gnu99 -O0 -g -DHAVE_ZLIB -DHAVE_ZLIB_DEFLATE -DRPNG_TEST -I../../include - -all: $(TARGET) - -%.o: %.c - $(CC) -c -o $@ $< $(CFLAGS) - -$(TARGET): $(OBJS) - $(CC) -o $@ $^ $(LDFLAGS) - -clean: - rm -f $(TARGET) $(OBJS) - -.PHONY: clean - diff --git a/libretro-common/formats/png/test/Makefile b/libretro-common/formats/png/test/Makefile new file mode 100644 index 0000000000..dcf47ecd37 --- /dev/null +++ b/libretro-common/formats/png/test/Makefile @@ -0,0 +1,43 @@ +TARGET := rpng + +LIBRETRO_PNG_DIR := .. +LIBRETRO_COMM_DIR := ../../.. + +HAVE_IMLIB2=1 + +LDFLAGS += -lz + +ifeq ($(HAVE_IMLIB2),1) +CFLAGS += -DHAVE_IMLIB2 +LDFLAGS += -lImlib2 +endif + +SOURCES_C := \ + rpng_test.c \ + $(LIBRETRO_PNG_DIR)/rpng.c \ + $(LIBRETRO_PNG_DIR)/rpng_encode.c \ + $(LIBRETRO_COMM_DIR)/compat/compat_strl.c \ + $(LIBRETRO_COMM_DIR)/file/nbio/nbio_stdio.c \ + $(LIBRETRO_COMM_DIR)/file/archive_file.c \ + $(LIBRETRO_COMM_DIR)/file/archive_file_zlib.c \ + $(LIBRETRO_COMM_DIR)//file/file_path.c \ + $(LIBRETRO_COMM_DIR)/streams/file_stream.c \ + $(LIBRETRO_COMM_DIR)/lists/string_list.c + +OBJS := $(SOURCES_C:.c=.o) + +CFLAGS += -Wall -pedantic -std=gnu99 -O0 -g -DHAVE_ZLIB -DHAVE_ZLIB_DEFLATE -DRPNG_TEST -I$(LIBRETRO_COMM_DIR)/include + +all: $(TARGET) + +%.o: %.c + $(CC) -c -o $@ $< $(CFLAGS) + +$(TARGET): $(OBJS) + $(CC) -o $@ $^ $(LDFLAGS) + +clean: + rm -f $(TARGET) $(OBJS) + +.PHONY: clean + diff --git a/libretro-common/formats/png/rpng_test.c b/libretro-common/formats/png/test/rpng_test.c similarity index 100% rename from libretro-common/formats/png/rpng_test.c rename to libretro-common/formats/png/test/rpng_test.c diff --git a/libretro-common/formats/xml/Makefile b/libretro-common/formats/xml/test/Makefile similarity index 67% rename from libretro-common/formats/xml/Makefile rename to libretro-common/formats/xml/test/Makefile index 1186c8e42d..3e2e3dbbb1 100644 --- a/libretro-common/formats/xml/Makefile +++ b/libretro-common/formats/xml/test/Makefile @@ -1,10 +1,12 @@ TARGET := rxml -LIBRETRO_COMM_DIR := ../.. +LIBRETRO_XML_DIR := .. +LIBRETRO_COMM_DIR := ../../.. SOURCES := \ - $(wildcard *.c) \ - $(LIBRETRO_COMM_DIR)/file/retro_file.c + rxml_test.c \ + $(LIBRETRO_XML_DIR)/rxml.c \ + $(LIBRETRO_COMM_DIR)/streams/file_stream.c OBJS := $(SOURCES:.c=.o) diff --git a/libretro-common/formats/xml/rxml_test.c b/libretro-common/formats/xml/test/rxml_test.c similarity index 100% rename from libretro-common/formats/xml/rxml_test.c rename to libretro-common/formats/xml/test/rxml_test.c