Skip to content
44 changes: 30 additions & 14 deletions Makefile.pre.in
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,8 @@ MODULE_OBJS= \
Modules/main.o \
Modules/gcmodule.o

IO_H= Modules/_io/_iomodule.h
IO_H= Modules/_io/_iomodule.h \
Copy link
Contributor

@erlend-aasland erlend-aasland Oct 26, 2024

Choose a reason for hiding this comment

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

Please add a line break first, similar to how it's done with IO_OBJS below.

Include/internal/pycore_emscripten_trampoline.h

IO_OBJS= \
Modules/_io/_iomodule.o \
Expand Down Expand Up @@ -685,6 +686,8 @@ LIBHACL_BLAKE2_HEADERS= \
Modules/_hacl/internal/Hacl_Impl_Blake2_Constants.h \
Modules/_hacl/internal/Hacl_Hash_Blake2s_Simd128.h \
Modules/_hacl/internal/Hacl_Hash_Blake2b_Simd256.h \
Modules/_hacl/lib_memzero0.h \
Modules/_hacl/libintvector.h \
$(LIBHACL_HEADERS)

#########################################################################
Expand Down Expand Up @@ -1200,6 +1203,7 @@ PYTHON_HEADERS= \
$(srcdir)/Include/internal/pycore_dict.h \
$(srcdir)/Include/internal/pycore_dict_state.h \
$(srcdir)/Include/internal/pycore_dtoa.h \
$(srcdir)/Include/internal/pycore_emscripten_trampoline.h \
$(srcdir)/Include/internal/pycore_exceptions.h \
$(srcdir)/Include/internal/pycore_faulthandler.h \
$(srcdir)/Include/internal/pycore_fileutils.h \
Expand Down Expand Up @@ -1293,6 +1297,7 @@ PYTHON_HEADERS= \
$(srcdir)/Include/internal/pycore_uop_metadata.h \
$(srcdir)/Include/internal/pycore_warnings.h \
$(srcdir)/Include/internal/pycore_weakref.h \
$(srcdir)/Python/condvar.h \
Copy link
Contributor

Choose a reason for hiding this comment

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

As I mentioned in my previous review, this should be a dependency of ceval_gil.o (and not ceval.o, as it currently is). IOW:

  • I don't think it is right to include it in PYTHON_HEADERS
  • I think we should remove condvar.h from the ceval.o target
  • I think we need a separate target for ceval_gil.o

Copy link
Author

Choose a reason for hiding this comment

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

If we declare ceval_gil.o as a separate target, what line should it go on?

Copy link
Contributor

Choose a reason for hiding this comment

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

It should be near the ceval.o target.

Copy link
Author

Choose a reason for hiding this comment

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

I already updated the PR. Could you add a label “skip news”?

$(DTRACE_HEADERS) \
@PLATFORM_HEADERS@ \
\
Expand Down Expand Up @@ -1580,7 +1585,7 @@ FROZEN_FILES_OUT = \
Python/frozen_modules/frozen_only.h
# End FROZEN_FILES_OUT

Programs/_freeze_module.o: Programs/_freeze_module.c Makefile
Programs/_freeze_module.o: $(srcdir)/Programs/_freeze_module.c Makefile

Modules/getpath_noop.o: $(srcdir)/Modules/getpath_noop.c Makefile

Expand Down Expand Up @@ -1754,23 +1759,23 @@ Programs/python.o: $(srcdir)/Programs/python.c
Programs/_testembed.o: $(srcdir)/Programs/_testembed.c Programs/test_frozenmain.h $(PYTHON_HEADERS)
$(CC) -c $(PY_CORE_CFLAGS) -o $@ $(srcdir)/Programs/_testembed.c

Modules/_sre/sre.o: $(srcdir)/Modules/_sre/sre.c $(srcdir)/Modules/_sre/sre.h $(srcdir)/Modules/_sre/sre_constants.h $(srcdir)/Modules/_sre/sre_lib.h
Modules/_sre/sre.o: $(srcdir)/Modules/_sre/sre.c $(srcdir)/Modules/_sre/sre.h $(srcdir)/Modules/_sre/sre_constants.h $(srcdir)/Modules/_sre/sre_lib.h $(srcdir)/Modules/_sre/sre_targets.h

Modules/posixmodule.o: $(srcdir)/Modules/posixmodule.c $(srcdir)/Modules/posixmodule.h
Modules/posixmodule.o: $(srcdir)/Modules/posixmodule.c $(srcdir)/Modules/posixmodule.h $(srcdir)/Include/internal/pycore_emscripten_trampoline.h
Copy link
Contributor

Choose a reason for hiding this comment

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

Why all these pycore_emscripten_trampoline.h dependencies? Can you elaborate?

Copy link
Author

Choose a reason for hiding this comment

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

I traced the build of Modules/posixmodule.o and found that Make calls pycore_emscripten_trampoline.h, which I can of course remove.

Copy link
Contributor

Choose a reason for hiding this comment

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

Please remove all the pycore_emscripten_trampoline.h deps; they are only relevant for that particular build config, and we need a better way to do those anyway.


Modules/grpmodule.o: $(srcdir)/Modules/grpmodule.c $(srcdir)/Modules/posixmodule.h

Modules/pwdmodule.o: $(srcdir)/Modules/pwdmodule.c $(srcdir)/Modules/posixmodule.h

Modules/signalmodule.o: $(srcdir)/Modules/signalmodule.c $(srcdir)/Modules/posixmodule.h
Modules/signalmodule.o: $(srcdir)/Modules/signalmodule.c $(srcdir)/Modules/posixmodule.h $(srcdir)/Include/internal/pycore_emscripten_signal.h

Modules/_interpretersmodule.o: $(srcdir)/Modules/_interpretersmodule.c $(srcdir)/Modules/_interpreters_common.h

Modules/_interpqueuesmodule.o: $(srcdir)/Modules/_interpqueuesmodule.c $(srcdir)/Modules/_interpreters_common.h

Modules/_interpchannelsmodule.o: $(srcdir)/Modules/_interpchannelsmodule.c $(srcdir)/Modules/_interpreters_common.h

Python/crossinterp.o: $(srcdir)/Python/crossinterp.c $(srcdir)/Python/crossinterp_data_lookup.h $(srcdir)/Python/crossinterp_exceptions.h
Python/crossinterp.o: $(srcdir)/Python/crossinterp.c $(srcdir)/Python/crossinterp_data_lookup.h $(srcdir)/Python/crossinterp_exceptions.h $(srcdir)/Include/internal/pycore_emscripten_trampoline.h

Python/initconfig.o: $(srcdir)/Python/initconfig.c $(srcdir)/Python/config_common.h

Expand All @@ -1786,7 +1791,7 @@ Python/dynload_hpux.o: $(srcdir)/Python/dynload_hpux.c Makefile
-DSHLIB_EXT='"$(EXT_SUFFIX)"' \
-o $@ $(srcdir)/Python/dynload_hpux.c

Python/sysmodule.o: $(srcdir)/Python/sysmodule.c Makefile $(srcdir)/Include/pydtrace.h
Python/sysmodule.o: $(srcdir)/Python/sysmodule.c Makefile $(srcdir)/Include/pydtrace.h $(srcdir)/Include/internal/pycore_emscripten_trampoline.h
$(CC) -c $(PY_CORE_CFLAGS) \
-DABIFLAGS='"$(ABIFLAGS)"' \
$(MULTIARCH_CPPFLAGS) \
Expand Down Expand Up @@ -1899,8 +1904,10 @@ BYTESTR_DEPS = \
$(srcdir)/Objects/stringlib/ctype.h \
$(srcdir)/Objects/stringlib/fastsearch.h \
$(srcdir)/Objects/stringlib/find.h \
$(srcdir)/Objects/stringlib/find_max_char.h \
$(srcdir)/Objects/stringlib/join.h \
$(srcdir)/Objects/stringlib/partition.h \
$(srcdir)/Include/internal/pycore_emscripten_trampoline.h \
$(srcdir)/Objects/stringlib/split.h \
$(srcdir)/Objects/stringlib/stringdefs.h \
$(srcdir)/Objects/stringlib/transmogrify.h
Expand All @@ -1914,29 +1921,33 @@ UNICODE_DEPS = \
$(srcdir)/Objects/stringlib/find_max_char.h \
$(srcdir)/Objects/stringlib/localeutil.h \
$(srcdir)/Objects/stringlib/partition.h \
$(srcdir)/Include/internal/pycore_emscripten_trampoline.h \
$(srcdir)/Objects/stringlib/replace.h \
$(srcdir)/Objects/stringlib/repr.h \
$(srcdir)/Objects/stringlib/split.h \
$(srcdir)/Objects/stringlib/ucs1lib.h \
$(srcdir)/Objects/stringlib/ucs2lib.h \
$(srcdir)/Objects/stringlib/ucs4lib.h \
$(srcdir)/Objects/stringlib/undef.h \
$(srcdir)/Objects/stringlib/unicode_format.h
$(srcdir)/Objects/stringlib/unicode_format.h \
$(srcdir)/Objects/stringlib/eq.h

Objects/bytes_methods.o: $(srcdir)/Objects/bytes_methods.c $(BYTESTR_DEPS)
Objects/bytesobject.o: $(srcdir)/Objects/bytesobject.c $(BYTESTR_DEPS)
Objects/bytearrayobject.o: $(srcdir)/Objects/bytearrayobject.c $(BYTESTR_DEPS)

Objects/unicodeobject.o: $(srcdir)/Objects/unicodeobject.c $(UNICODE_DEPS)

Objects/dictobject.o: $(srcdir)/Objects/stringlib/eq.h
Objects/setobject.o: $(srcdir)/Objects/stringlib/eq.h
Objects/dictobject.o: $(srcdir)/Objects/stringlib/eq.h $(srcdir)/Include/internal/pycore_emscripten_trampoline.h
Objects/setobject.o: $(srcdir)/Objects/stringlib/eq.h $(srcdir)/Include/internal/pycore_emscripten_trampoline.h

Objects/obmalloc.o: $(srcdir)/Objects/mimalloc/alloc.c \
$(srcdir)/Objects/mimalloc/alloc-aligned.c \
$(srcdir)/Objects/mimalloc/alloc-override.c \
$(srcdir)/Objects/mimalloc/alloc-posix.c \
$(srcdir)/Objects/mimalloc/arena.c \
$(srcdir)/Objects/mimalloc/bitmap.c \
$(srcdir)/Objects/mimalloc/bitmap.h \
$(srcdir)/Objects/mimalloc/heap.c \
$(srcdir)/Objects/mimalloc/init.c \
$(srcdir)/Objects/mimalloc/options.c \
Expand All @@ -1945,11 +1956,14 @@ Objects/obmalloc.o: $(srcdir)/Objects/mimalloc/alloc.c \
$(srcdir)/Objects/mimalloc/random.c \
$(srcdir)/Objects/mimalloc/segment.c \
$(srcdir)/Objects/mimalloc/segment-map.c \
$(srcdir)/Objects/mimalloc/static.c \
$(srcdir)/Objects/mimalloc/stats.c \
$(srcdir)/Objects/mimalloc/page-queue.c \
Copy link
Contributor

Choose a reason for hiding this comment

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

Please make sure you add lines so the list is still alphabetically sorted. Moreover, page-queue.c is already a dependency of the page.o subtarget; I think we should remove that target, as page.c is #included in the source, not compiled as a separate source file.

$(srcdir)/Objects/mimalloc/prim/prim.c \
$(srcdir)/Objects/mimalloc/prim/osx/prim.c \
$(srcdir)/Objects/mimalloc/prim/unix/prim.c \
$(srcdir)/Objects/mimalloc/prim/wasi/prim.c
$(srcdir)/Objects/mimalloc/prim/wasi/prim.c \
$(srcdir)/Include/internal/pycore_emscripten_trampoline.h

Objects/mimalloc/page.o: $(srcdir)/Objects/mimalloc/page-queue.c

Expand Down Expand Up @@ -2027,6 +2041,8 @@ Python/compile.o Python/codegen.o Python/assemble.o Python/flowgraph.o Python/in
$(srcdir)/Include/internal/pycore_opcode_utils.h

Python/ceval.o: \
$(srcdir)/Include/internal/pycore_emscripten_signal.h \
$(srcdir)/Include/internal/pycore_emscripten_trampoline.h \
$(srcdir)/Python/ceval_macros.h \
$(srcdir)/Python/condvar.h \
$(srcdir)/Python/generated_cases.c.h \
Expand Down Expand Up @@ -2059,13 +2075,13 @@ Include/pydtrace_probes.h: $(srcdir)/Include/pydtrace.d
mv [email protected] $@

Python/ceval.o: $(srcdir)/Include/pydtrace.h
Python/gc.o: $(srcdir)/Include/pydtrace.h
Python/import.o: $(srcdir)/Include/pydtrace.h
Python/gc.o: $(srcdir)/Include/pydtrace.h $(srcdir)/Include/internal/pycore_emscripten_trampoline.h
Python/import.o: $(srcdir)/Include/pydtrace.h $(srcdir)/Include/internal/pycore_emscripten_trampoline.h $(srcdir)/Include/internal/pycore_magic_number.h

Python/pydtrace.o: $(srcdir)/Include/pydtrace.d $(DTRACE_DEPS)
$(DTRACE) $(DFLAGS) -o $@ -G -s $< $(DTRACE_DEPS)

Objects/typeobject.o: Objects/typeslots.inc
Objects/typeobject.o: Objects/typeslots.inc $(srcdir)/Include/internal/pycore_emscripten_trampoline.h

.PHONY: regen-typeslots
regen-typeslots:
Expand Down
Loading