Skip to content

Commit

Permalink
Update Makefile to not recreate zconf.h and zconf.h.cmakein.
Browse files Browse the repository at this point in the history
Both were removed as zconf.h.cmakein is no longer needed, and
zconf.h is made from zconf.h.in.
  • Loading branch information
madler committed Feb 1, 2025
1 parent 61a56bc commit ec346f1
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
*.gcno
*.gcov

zconf.h
/example
/example64
/examplesh
Expand Down
22 changes: 11 additions & 11 deletions Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -355,15 +355,15 @@ docs: zlib.3.pdf
zlib.3.pdf: $(SRCDIR)zlib.3
groff -mandoc -f H -T ps $(SRCDIR)zlib.3 | ps2pdf - $@

zconf.h.cmakein: $(SRCDIR)zconf.h.in
-@ TEMPFILE=zconfh_$$; \
echo "/#define ZCONF_H/ a\\\\\n#cmakedefine Z_PREFIX\\\\\n#cmakedefine Z_HAVE_UNISTD_H\n" >> $$TEMPFILE &&\
sed -f $$TEMPFILE $(SRCDIR)zconf.h.in > $@ &&\
touch -r $(SRCDIR)zconf.h.in $@ &&\
rm $$TEMPFILE

zconf: $(SRCDIR)zconf.h.in
cp -p $(SRCDIR)zconf.h.in zconf.h
# zconf.h.cmakein: $(SRCDIR)zconf.h.in
# -@ TEMPFILE=zconfh_$$; \
# echo "/#define ZCONF_H/ a\\\\\n#cmakedefine Z_PREFIX\\\\\n#cmakedefine Z_HAVE_UNISTD_H\n" >> $$TEMPFILE &&\
# sed -f $$TEMPFILE $(SRCDIR)zconf.h.in > $@ &&\
# touch -r $(SRCDIR)zconf.h.in $@ &&\
# rm $$TEMPFILE
#
# zconf: $(SRCDIR)zconf.h.in
# cp -p $(SRCDIR)zconf.h.in zconf.h

minizip-test: static
cd contrib/minizip && { CC="$(CC)" CFLAGS="$(CFLAGS)" $(MAKE) test ; cd ../.. ; }
Expand All @@ -384,8 +384,8 @@ clean: minizip-clean
rm -f contrib/infback9/*.gcda contrib/infback9/*.gcno contrib/infback9/*.gcov

maintainer-clean: distclean
distclean: clean zconf zconf.h.cmakein
rm -f Makefile zlib.pc configure.log
distclean: clean # zconf zconf.h.cmakein
rm -f Makefile zlib.pc configure.log zconf.h
-@rm -f .DS_Store
@if [ -f Makefile.in ]; then \
printf 'all:\n\t-@echo "Please use ./configure first. Thank you."\n' > Makefile ; \
Expand Down

4 comments on commit ec346f1

@irwir
Copy link

@irwir irwir commented on ec346f1 Feb 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Visual Studio projects fail without zconf.h.
Custom Build Tool might be used here.

@madler
Copy link
Owner Author

@madler madler commented on ec346f1 Feb 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@irwir Can you submit an issue for this?

@irwir
Copy link

@irwir irwir commented on ec346f1 Feb 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you need a issue or a fix in PR?

@madler
Copy link
Owner Author

@madler madler commented on ec346f1 Feb 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@irwir A fix would be even better.

Please sign in to comment.