From 403cd3a44759b5ad844762abf1d8eeeaf58b595e Mon Sep 17 00:00:00 2001 From: Ozkan Sezer Date: Sun, 10 Nov 2019 11:00:02 +0300 Subject: [PATCH] external libs: add missing standalone makefiles (.hgignore was in the way.) --- external/tiff-4.0.3/libtiff/mingw/Makefile | 68 ++++++++++ external/zlib-1.2.8/Makefile | 5 + external/zlib-1.2.8/contrib/blast/Makefile | 8 ++ external/zlib-1.2.8/contrib/minizip/Makefile | 25 ++++ external/zlib-1.2.8/contrib/puff/Makefile | 42 +++++++ external/zlib-1.2.8/contrib/untgz/Makefile | 14 +++ external/zlib-1.2.8/nintendods/Makefile | 126 +++++++++++++++++++ 7 files changed, 288 insertions(+) create mode 100644 external/tiff-4.0.3/libtiff/mingw/Makefile create mode 100644 external/zlib-1.2.8/Makefile create mode 100644 external/zlib-1.2.8/contrib/blast/Makefile create mode 100644 external/zlib-1.2.8/contrib/minizip/Makefile create mode 100644 external/zlib-1.2.8/contrib/puff/Makefile create mode 100644 external/zlib-1.2.8/contrib/untgz/Makefile create mode 100644 external/zlib-1.2.8/nintendods/Makefile diff --git a/external/tiff-4.0.3/libtiff/mingw/Makefile b/external/tiff-4.0.3/libtiff/mingw/Makefile new file mode 100644 index 00000000..8348e8de --- /dev/null +++ b/external/tiff-4.0.3/libtiff/mingw/Makefile @@ -0,0 +1,68 @@ +CROSS = +CC = $(CROSS)gcc + +DLLNAME = libtiff-5.dll +LIBNAME = libtiff.dll.a +INCLUDES= -I. -Iexternal/include +CPPFLAGS= -DDLL_EXPORT +CFLAGS = -O2 -Wall +LDFLAGS = -Wl,--enable-auto-image-base -Wl,--no-undefined +LDLIBS = -Lexternal/lib -ljpeg -lz + +OBJ = tif_aux.o \ + tif_close.o \ + tif_codec.o \ + tif_color.o \ + tif_compress.o \ + tif_dir.o \ + tif_dirinfo.o \ + tif_dirread.o \ + tif_dirwrite.o \ + tif_dumpmode.o \ + tif_error.o \ + tif_extension.o \ + tif_fax3.o \ + tif_fax3sm.o \ + tif_flush.o \ + tif_getimage.o \ + tif_jbig.o \ + tif_jpeg.o \ + tif_jpeg_12.o \ + tif_luv.o \ + tif_lzma.o \ + tif_lzw.o \ + tif_next.o \ + tif_ojpeg.o \ + tif_open.o \ + tif_packbits.o \ + tif_pixarlog.o \ + tif_predict.o \ + tif_print.o \ + tif_read.o \ + tif_strip.o \ + tif_swab.o \ + tif_thunder.o \ + tif_tile.o \ + tif_version.o \ + tif_warning.o \ + tif_write.o \ + tif_zip.o \ + tif_win32.o + +all: $(DLLNAME) + +.PHONY: clean distclean +.SUFFIXES: +.SUFFIXES: .o .c + +%.o: ../%.c + $(CC) -c $(CPPFLAGS) $(INCLUDES) $(CFLAGS) -o $@ $< + +$(DLLNAME): $(OBJ) + $(CC) -shared -o $(DLLNAME) ../libtiff.def $(OBJ) $(LDFLAGS) $(LDLIBS) \ + -Xlinker --out-implib -Xlinker $(LIBNAME) + +distclean: clean + $(RM) *.dll *.a +clean: + $(RM) *.o diff --git a/external/zlib-1.2.8/Makefile b/external/zlib-1.2.8/Makefile new file mode 100644 index 00000000..6bba86c7 --- /dev/null +++ b/external/zlib-1.2.8/Makefile @@ -0,0 +1,5 @@ +all: + -@echo "Please use ./configure first. Thank you." + +distclean: + make -f Makefile.in distclean diff --git a/external/zlib-1.2.8/contrib/blast/Makefile b/external/zlib-1.2.8/contrib/blast/Makefile new file mode 100644 index 00000000..9be80baf --- /dev/null +++ b/external/zlib-1.2.8/contrib/blast/Makefile @@ -0,0 +1,8 @@ +blast: blast.c blast.h + cc -DTEST -o blast blast.c + +test: blast + blast < test.pk | cmp - test.txt + +clean: + rm -f blast blast.o diff --git a/external/zlib-1.2.8/contrib/minizip/Makefile b/external/zlib-1.2.8/contrib/minizip/Makefile new file mode 100644 index 00000000..84eaad20 --- /dev/null +++ b/external/zlib-1.2.8/contrib/minizip/Makefile @@ -0,0 +1,25 @@ +CC=cc +CFLAGS=-O -I../.. + +UNZ_OBJS = miniunz.o unzip.o ioapi.o ../../libz.a +ZIP_OBJS = minizip.o zip.o ioapi.o ../../libz.a + +.c.o: + $(CC) -c $(CFLAGS) $*.c + +all: miniunz minizip + +miniunz: $(UNZ_OBJS) + $(CC) $(CFLAGS) -o $@ $(UNZ_OBJS) + +minizip: $(ZIP_OBJS) + $(CC) $(CFLAGS) -o $@ $(ZIP_OBJS) + +test: miniunz minizip + ./minizip test readme.txt + ./miniunz -l test.zip + mv readme.txt readme.old + ./miniunz test.zip + +clean: + /bin/rm -f *.o *~ minizip miniunz diff --git a/external/zlib-1.2.8/contrib/puff/Makefile b/external/zlib-1.2.8/contrib/puff/Makefile new file mode 100644 index 00000000..0e2594c8 --- /dev/null +++ b/external/zlib-1.2.8/contrib/puff/Makefile @@ -0,0 +1,42 @@ +CFLAGS=-O + +puff: puff.o pufftest.o + +puff.o: puff.h + +pufftest.o: puff.h + +test: puff + puff zeros.raw + +puft: puff.c puff.h pufftest.o + cc -fprofile-arcs -ftest-coverage -o puft puff.c pufftest.o + +# puff full coverage test (should say 100%) +cov: puft + @rm -f *.gcov *.gcda + @puft -w zeros.raw 2>&1 | cat > /dev/null + @echo '04' | xxd -r -p | puft 2> /dev/null || test $$? -eq 2 + @echo '00' | xxd -r -p | puft 2> /dev/null || test $$? -eq 2 + @echo '00 00 00 00 00' | xxd -r -p | puft 2> /dev/null || test $$? -eq 254 + @echo '00 01 00 fe ff' | xxd -r -p | puft 2> /dev/null || test $$? -eq 2 + @echo '01 01 00 fe ff 0a' | xxd -r -p | puft -f 2>&1 | cat > /dev/null + @echo '02 7e ff ff' | xxd -r -p | puft 2> /dev/null || test $$? -eq 246 + @echo '02' | xxd -r -p | puft 2> /dev/null || test $$? -eq 2 + @echo '04 80 49 92 24 49 92 24 0f b4 ff ff c3 04' | xxd -r -p | puft 2> /dev/null || test $$? -eq 2 + @echo '04 80 49 92 24 49 92 24 71 ff ff 93 11 00' | xxd -r -p | puft 2> /dev/null || test $$? -eq 249 + @echo '04 c0 81 08 00 00 00 00 20 7f eb 0b 00 00' | xxd -r -p | puft 2> /dev/null || test $$? -eq 246 + @echo '0b 00 00' | xxd -r -p | puft -f 2>&1 | cat > /dev/null + @echo '1a 07' | xxd -r -p | puft 2> /dev/null || test $$? -eq 246 + @echo '0c c0 81 00 00 00 00 00 90 ff 6b 04' | xxd -r -p | puft 2> /dev/null || test $$? -eq 245 + @puft -f zeros.raw 2>&1 | cat > /dev/null + @echo 'fc 00 00' | xxd -r -p | puft 2> /dev/null || test $$? -eq 253 + @echo '04 00 fe ff' | xxd -r -p | puft 2> /dev/null || test $$? -eq 252 + @echo '04 00 24 49' | xxd -r -p | puft 2> /dev/null || test $$? -eq 251 + @echo '04 80 49 92 24 49 92 24 0f b4 ff ff c3 84' | xxd -r -p | puft 2> /dev/null || test $$? -eq 248 + @echo '04 00 24 e9 ff ff' | xxd -r -p | puft 2> /dev/null || test $$? -eq 250 + @echo '04 00 24 e9 ff 6d' | xxd -r -p | puft 2> /dev/null || test $$? -eq 247 + @gcov -n puff.c + +clean: + rm -f puff puft *.o *.gc* diff --git a/external/zlib-1.2.8/contrib/untgz/Makefile b/external/zlib-1.2.8/contrib/untgz/Makefile new file mode 100644 index 00000000..b54266fb --- /dev/null +++ b/external/zlib-1.2.8/contrib/untgz/Makefile @@ -0,0 +1,14 @@ +CC=cc +CFLAGS=-g + +untgz: untgz.o ../../libz.a + $(CC) $(CFLAGS) -o untgz untgz.o -L../.. -lz + +untgz.o: untgz.c ../../zlib.h + $(CC) $(CFLAGS) -c -I../.. untgz.c + +../../libz.a: + cd ../..; ./configure; make + +clean: + rm -f untgz untgz.o *~ diff --git a/external/zlib-1.2.8/nintendods/Makefile b/external/zlib-1.2.8/nintendods/Makefile new file mode 100644 index 00000000..21337d01 --- /dev/null +++ b/external/zlib-1.2.8/nintendods/Makefile @@ -0,0 +1,126 @@ +#--------------------------------------------------------------------------------- +.SUFFIXES: +#--------------------------------------------------------------------------------- + +ifeq ($(strip $(DEVKITARM)),) +$(error "Please set DEVKITARM in your environment. export DEVKITARM=devkitARM") +endif + +include $(DEVKITARM)/ds_rules + +#--------------------------------------------------------------------------------- +# TARGET is the name of the output +# BUILD is the directory where object files & intermediate files will be placed +# SOURCES is a list of directories containing source code +# DATA is a list of directories containing data files +# INCLUDES is a list of directories containing header files +#--------------------------------------------------------------------------------- +TARGET := $(shell basename $(CURDIR)) +BUILD := build +SOURCES := ../../ +DATA := data +INCLUDES := include + +#--------------------------------------------------------------------------------- +# options for code generation +#--------------------------------------------------------------------------------- +ARCH := -mthumb -mthumb-interwork + +CFLAGS := -Wall -O2\ + -march=armv5te -mtune=arm946e-s \ + -fomit-frame-pointer -ffast-math \ + $(ARCH) + +CFLAGS += $(INCLUDE) -DARM9 +CXXFLAGS := $(CFLAGS) -fno-rtti -fno-exceptions + +ASFLAGS := $(ARCH) -march=armv5te -mtune=arm946e-s +LDFLAGS = -specs=ds_arm9.specs -g $(ARCH) -Wl,-Map,$(notdir $*.map) + +#--------------------------------------------------------------------------------- +# list of directories containing libraries, this must be the top level containing +# include and lib +#--------------------------------------------------------------------------------- +LIBDIRS := $(LIBNDS) + +#--------------------------------------------------------------------------------- +# no real need to edit anything past this point unless you need to add additional +# rules for different file extensions +#--------------------------------------------------------------------------------- +ifneq ($(BUILD),$(notdir $(CURDIR))) +#--------------------------------------------------------------------------------- + +export OUTPUT := $(CURDIR)/lib/libz.a + +export VPATH := $(foreach dir,$(SOURCES),$(CURDIR)/$(dir)) \ + $(foreach dir,$(DATA),$(CURDIR)/$(dir)) + +export DEPSDIR := $(CURDIR)/$(BUILD) + +CFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.c))) +CPPFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.cpp))) +SFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.s))) +BINFILES := $(foreach dir,$(DATA),$(notdir $(wildcard $(dir)/*.*))) + +#--------------------------------------------------------------------------------- +# use CXX for linking C++ projects, CC for standard C +#--------------------------------------------------------------------------------- +ifeq ($(strip $(CPPFILES)),) +#--------------------------------------------------------------------------------- + export LD := $(CC) +#--------------------------------------------------------------------------------- +else +#--------------------------------------------------------------------------------- + export LD := $(CXX) +#--------------------------------------------------------------------------------- +endif +#--------------------------------------------------------------------------------- + +export OFILES := $(addsuffix .o,$(BINFILES)) \ + $(CPPFILES:.cpp=.o) $(CFILES:.c=.o) $(SFILES:.s=.o) + +export INCLUDE := $(foreach dir,$(INCLUDES),-I$(CURDIR)/$(dir)) \ + $(foreach dir,$(LIBDIRS),-I$(dir)/include) \ + -I$(CURDIR)/$(BUILD) + +.PHONY: $(BUILD) clean all + +#--------------------------------------------------------------------------------- +all: $(BUILD) + @[ -d $@ ] || mkdir -p include + @cp ../../*.h include + +lib: + @[ -d $@ ] || mkdir -p $@ + +$(BUILD): lib + @[ -d $@ ] || mkdir -p $@ + @$(MAKE) --no-print-directory -C $(BUILD) -f $(CURDIR)/Makefile + +#--------------------------------------------------------------------------------- +clean: + @echo clean ... + @rm -fr $(BUILD) lib + +#--------------------------------------------------------------------------------- +else + +DEPENDS := $(OFILES:.o=.d) + +#--------------------------------------------------------------------------------- +# main targets +#--------------------------------------------------------------------------------- +$(OUTPUT) : $(OFILES) + +#--------------------------------------------------------------------------------- +%.bin.o : %.bin +#--------------------------------------------------------------------------------- + @echo $(notdir $<) + @$(bin2o) + + +-include $(DEPENDS) + +#--------------------------------------------------------------------------------------- +endif +#---------------------------------------------------------------------------------------