--- src/Makefile	2024-08-14 22:39:50.000000000 +0800
+++ src/Makefile	2025-08-11 16:47:11.000000000 +0800
@@ -2,16 +2,16 @@
 # Please read docs/Readme.html, or http://www.analog.cx/
 # This is a general Unix-like Makefile: Makefiles for other OS's can be found
 #   in the "build" directory.
-CC = gcc           # which compiler to use: eg cc, acc, gcc. NB Different
+CC =? gcc           # which compiler to use: eg cc, acc, gcc. NB Different
 #                    compilers need different CFLAGS, e.g., -O instead of -O2.
 MAKE = make        # which "make" to use
-CFLAGS = -O2    # options, e.g. for optimisation or ANSI compilation.
+#CFLAGS = -O2    # options, e.g. for optimisation or ANSI compilation.
 #                 Some OS's need -D_FILE_OFFSET_BITS=64 to support files > 2MB.
 #                 HP/UX cc needs CFLAGS = -Aa (HP/UX 9) or -Ae (HP/UX 10)
 #                 BeOS needs CFLAGS = -O2 -Wl,-L/boot/home/config/lib
 #                 BS2000/OSD needs CFLAGS = -XLLML -XLLMK
 #                 NeXTSTEP needs CFLAGS = -O2 -pipe -no-precomp 
-DEFS =          # any combination of -DNOPIPES -DNODNS -DNODIRENT -DNOGLOB ...
+#DEFS =          # any combination of -DNOPIPES -DNODNS -DNODIRENT -DNOGLOB ...
 #                 ... -DNOOPEN -DNOFOLLOW -DNOALARM -DNOGRAPHICS -DNOGMTIME ...
 #                 ... -DEBCDIC -DUSE_PLAIN_SETJMP ...
 #                 ... -DHAVE_GD -DHAVE_ZLIB -DHAVE_BZLIB -DHAVE_PCRE ...
@@ -28,9 +28,9 @@
 #                 DYNIX/ptx needs DEFS = -D_SOCKET_VERSION=11
 #                 MPE/iX needs DEFS = -D_POSIX_SOURCE -D_SOCKET_SOURCE
 #
-OS = UNIX         # Operating system: UNIX, DOS, WIN32, MAC, OS2, OSX, VMS
+#OS = UNIX         # Operating system: UNIX, DOS, WIN32, MAC, OS2, OSX, VMS
 #                   RISCOS, BEOS, NEXTSTEP, MPEIX, BS2000, AS400, OS390
-LIBS = -lm        # extra libraries needed; most platforms (but not OS X or BeOS)
+#LIBS = -lm # extra libraries needed; most platforms (but not OS X or BeOS)
 #               need -lm LAST
 #             if you defined HAVE_GD above you also need -lgd -lpng -ljpeg -lz
 #             if you defined HAVE_ZLIB above you also need -lz
@@ -54,41 +54,12 @@
 	input.o macinput.o macstuff.o output.o output2.o outcro.o outhtml.o \
 	outlatex.o outplain.o outxhtml.o outxml.o process.o settings.o sort.o \
 	tree.o utils.o win32.o
-SUBDIRS = bzip2 libgd libpng pcre2 unzip zlib
+SUBDIRS = libgd unzip
 SUBDIROBJS = libgd/gd.o  libgd/gd_io.o libgd/gd_io_file.o libgd/gd_png.o \
 	libgd/gdfontf.o libgd/gdfonts.o libgd/gdtables.o \
-	libpng/png.o libpng/pngerror.o libpng/pngmem.o libpng/pngset.o \
-	libpng/pngtrans.o libpng/pngwio.o libpng/pngwrite.o \
-	libpng/pngwtran.o libpng/pngwutil.o \
-	pcre2/src/libpcre2_8_la-pcre2_auto_possess.o \
-	pcre2/src/libpcre2_8_la-pcre2_chartables.o \
-	pcre2/src/libpcre2_8_la-pcre2_chkdint.o \
-	pcre2/src/libpcre2_8_la-pcre2_compile.o \
-	pcre2/src/libpcre2_8_la-pcre2_context.o \
-	pcre2/src/libpcre2_8_la-pcre2_convert.o \
-	pcre2/src/libpcre2_8_la-pcre2_extuni.o \
-	pcre2/src/libpcre2_8_la-pcre2_find_bracket.o \
-	pcre2/src/libpcre2_8_la-pcre2_match.o \
-	pcre2/src/libpcre2_8_la-pcre2_match_data.o \
-	pcre2/src/libpcre2_8_la-pcre2_newline.o \
-	pcre2/src/libpcre2_8_la-pcre2_ord2utf.o \
-	pcre2/src/libpcre2_8_la-pcre2_pattern_info.o \
-	pcre2/src/libpcre2_8_la-pcre2_script_run.o \
-	pcre2/src/libpcre2_8_la-pcre2_string_utils.o \
-	pcre2/src/libpcre2_8_la-pcre2_study.o \
-	pcre2/src/libpcre2_8_la-pcre2_tables.o \
-	pcre2/src/libpcre2_8_la-pcre2_ucd.o \
-	pcre2/src/libpcre2_8_la-pcre2_valid_utf.o \
-	pcre2/src/libpcre2_8_la-pcre2_xclass.o \
-	zlib/adler32.o zlib/compress.o zlib/crc32.o zlib/deflate.o \
-	zlib/gzio.o zlib/infblock.o zlib/infcodes.o zlib/inffast.o \
-	zlib/inflate.o zlib/inftrees.o zlib/infutil.o zlib/trees.o \
-	zlib/uncompr.o zlib/zutil.o unzip/ioapi.o unzip/unzip.o \
-	bzip2/bzlib.o bzip2/blocksort.o bzip2/compress.o bzip2/crctable.o \
-	bzip2/decompress.o bzip2/huffman.o bzip2/randtable.o
+	unzip/ioapi.o unzip/unzip.o
 HEADERS = anlghead.h anlghea2.h anlghea3.h anlghea4.h macdir.h \
-	pcre2/src/pcre2.h.generic libgd/gd.h libgd/gdfontf.h libgd/gdfonts.h unzip/unzip.h \
-	zlib/zlib.h bzip2/bzlib.h
+	libgd/gd.h libgd/gdfontf.h libgd/gdfonts.h unzip/unzip.h
 ALLCFLAGS = $(CFLAGS) $(DEFS) -D$(OS)
 ALLOBJS = $(OBJS) $(SUBDIROBJS)
 
@@ -97,27 +68,12 @@
 
 # There doesn't seem to be a good way to write all these rules in a generic
 # form that works for all "make" programs
-bzip2: ALWAYS
-	cd bzip2 && $(MAKE) 'CC=$(CC)' 'ALLCFLAGS=$(ALLCFLAGS)'
-
 libgd: ALWAYS
 	cd libgd && $(MAKE) 'CC=$(CC)' 'ALLCFLAGS=$(ALLCFLAGS)'
 
-libpng: ALWAYS
-	cd libpng && $(MAKE) 'CC=$(CC)' 'ALLCFLAGS=$(ALLCFLAGS)'
-
-pcre2: ALWAYS
-	chmod 755 pcre2/132html pcre2/ar-lib pcre2/CheckMan pcre2/CleanTxt pcre2/compile pcre2/config.guess pcre2/config.sub pcre2/configure pcre2/depcomp pcre2/Detrail pcre2/install-sh pcre2/missing pcre2/perltest.sh pcre2/PrepareRelease pcre2/RunGrepTest pcre2/RunTest pcre2/test-driver
-	chmod 755 pcre2/cmake pcre2/doc pcre2/m4 pcre2/src pcre2/testdata pcre2/vms
-	chmod 755 pcre2/src/sljit pcre2/src/sljit/allocator_src/
-	cd pcre2 && ./configure && $(MAKE) 'CC=$(CC)' 'ALLCFLAGS=$(ALLCFLAGS)'
-
 unzip: ALWAYS
 	cd unzip && $(MAKE) 'CC=$(CC)' 'ALLCFLAGS=$(ALLCFLAGS)'
 
-zlib: ALWAYS
-	cd zlib && $(MAKE) 'CC=$(CC)' 'ALLCFLAGS=$(ALLCFLAGS)'
-
 alias.o: alias.c $(HEADERS) Makefile
 	$(CC) $(ALLCFLAGS) -c alias.c
 
