Skip to content

Deduplicate mk_linux.mk with makefile#124

Open
examosa wants to merge 1 commit into
ThomasMertes:masterfrom
examosa:dedupe_makefile
Open

Deduplicate mk_linux.mk with makefile#124
examosa wants to merge 1 commit into
ThomasMertes:masterfrom
examosa:dedupe_makefile

Conversation

@examosa
Copy link
Copy Markdown
Contributor

@examosa examosa commented Mar 18, 2026

Relates to #60

mk_linux.mk is almost identical to makefile. Here are their differences:

3,4c3,4
< #   make depend
< #   make
---
> #   make -f mk_linux.mak depend
> #   make -f mk_linux.mak
154,155c154,155
<       $(MAKE) s7
<       $(MAKE) s7c
---
>       $(MAKE) -f mk_linux.mak s7
>       $(MAKE) -f mk_linux.mak s7c
263c263
<       echo "#define MAKEFILE_NAME \"makefile\"" >> settings.h
---
>       echo "#define MAKEFILE_NAME \"mk_linux.mak\"" >> settings.h

I have updated mk_linux.mk to be a symlink pointing to makefile and updated the latter to work for either invocation.

  • Updated the all target to list s7 and s7c as prerequisites rather than recursively invoking $(MAKE)
  • Used the built-in MAKEFILE_LIST variable to derive makefile_name rather than hard-coding it.

Let me know your thoughts!

@ThomasMertes
Copy link
Copy Markdown
Owner

Thank you for your pull request.

The two files makefile and mk_linux.mak are separate on purpose. For several platforms the build documentation suggest copying a mk_*.mak file to makefile. If mk_linux.mak links to makefile the copying would change mk_linux.mak too. This would make it impossible to later copy mk_linux.mak to makefile in order to compile under Linux.

@examosa
Copy link
Copy Markdown
Contributor Author

examosa commented Mar 30, 2026

Since makefile itself is also designed for compiling under Linux, would it make more sense to remove mk_linux.mak entirely? Alternatively, I could create a separate GNUmakefile that both makefile and mk_linux.mak are linked to.
Ultimately the goal is to consolidate most of the redundancy across the various POSIX makefiles to reduce their maintenance burden; there are more details in this DeepWiki chat.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants