SRB2/src/Makefile

409 lines
9.1 KiB
Makefile
Raw Normal View History

Rewrite Makefile to be modular as well as more automated Some key points for programmers: - Source code files are mostly listed in a 'Sourcefile'. So you no longer directly edit the object list. There can be multiple Sourcefiles and they can even live in subdirectories--the directory name will be prepended to every filename in the list. Of course, the Makefile still needs to be edited to read from each Sourcefile. - Different rules are no longer required for source code files that live in subdirectories (such as sdl/ or hardware/). Subdirectories Just Work so go ham! In addition to those points, another important change is that the bin directory is no longer divided into platform subdirectories (Linux64, Mingw, etc). Executables now go directly into bin. If you use DEBUGMODE or target 64-bit, then subdirectories for 'debug' and '64' will be made though. Oh by the way, I don't think make clean actually removed files before on Windows. It should now. I also fixed as many little inconsistencies like that as I noticed. And now just an overview of the technical aspects that shouldn't affect anyone who doesn't REALLY care about the Makefile... objs and dep directories have been moved to a make directory. Makefile.cfg and its variants have been moved out of their various subdirectories to src/Makefile.d make distclean removes the bin and make directories entirely, but make clean and cleandep still only affect the current build target. When I say automation, I mean that a lot of copy pasting in the Makefile has been reduced.
2021-05-02 09:54:51 +00:00
# GNU Makefile for SRB2
# the poly3 Makefile adapted over and over...
#
# Copyright 1998-2000 DooM Legacy Team.
# Copyright 2020-2021 James R.
# Copyright 2003-2021 Sonic Team Junior.
2014-03-15 16:59:03 +00:00
#
# This program is free software distributed under the
# terms of the GNU General Public License, version 2.
# See the 'LICENSE' file for more details.
#
Rewrite Makefile to be modular as well as more automated Some key points for programmers: - Source code files are mostly listed in a 'Sourcefile'. So you no longer directly edit the object list. There can be multiple Sourcefiles and they can even live in subdirectories--the directory name will be prepended to every filename in the list. Of course, the Makefile still needs to be edited to read from each Sourcefile. - Different rules are no longer required for source code files that live in subdirectories (such as sdl/ or hardware/). Subdirectories Just Work so go ham! In addition to those points, another important change is that the bin directory is no longer divided into platform subdirectories (Linux64, Mingw, etc). Executables now go directly into bin. If you use DEBUGMODE or target 64-bit, then subdirectories for 'debug' and '64' will be made though. Oh by the way, I don't think make clean actually removed files before on Windows. It should now. I also fixed as many little inconsistencies like that as I noticed. And now just an overview of the technical aspects that shouldn't affect anyone who doesn't REALLY care about the Makefile... objs and dep directories have been moved to a make directory. Makefile.cfg and its variants have been moved out of their various subdirectories to src/Makefile.d make distclean removes the bin and make directories entirely, but make clean and cleandep still only affect the current build target. When I say automation, I mean that a lot of copy pasting in the Makefile has been reduced.
2021-05-02 09:54:51 +00:00
# Special targets:
2014-03-15 16:59:03 +00:00
#
Rewrite Makefile to be modular as well as more automated Some key points for programmers: - Source code files are mostly listed in a 'Sourcefile'. So you no longer directly edit the object list. There can be multiple Sourcefiles and they can even live in subdirectories--the directory name will be prepended to every filename in the list. Of course, the Makefile still needs to be edited to read from each Sourcefile. - Different rules are no longer required for source code files that live in subdirectories (such as sdl/ or hardware/). Subdirectories Just Work so go ham! In addition to those points, another important change is that the bin directory is no longer divided into platform subdirectories (Linux64, Mingw, etc). Executables now go directly into bin. If you use DEBUGMODE or target 64-bit, then subdirectories for 'debug' and '64' will be made though. Oh by the way, I don't think make clean actually removed files before on Windows. It should now. I also fixed as many little inconsistencies like that as I noticed. And now just an overview of the technical aspects that shouldn't affect anyone who doesn't REALLY care about the Makefile... objs and dep directories have been moved to a make directory. Makefile.cfg and its variants have been moved out of their various subdirectories to src/Makefile.d make distclean removes the bin and make directories entirely, but make clean and cleandep still only affect the current build target. When I say automation, I mean that a lot of copy pasting in the Makefile has been reduced.
2021-05-02 09:54:51 +00:00
# clean - remove executables and objects for this build
# cleandep - remove dependency files for this build
# distclean - remove entire executable, object and
# dependency file directory structure.
# dump - disassemble executable
Rewrite Makefile to be modular as well as more automated Some key points for programmers: - Source code files are mostly listed in a 'Sourcefile'. So you no longer directly edit the object list. There can be multiple Sourcefiles and they can even live in subdirectories--the directory name will be prepended to every filename in the list. Of course, the Makefile still needs to be edited to read from each Sourcefile. - Different rules are no longer required for source code files that live in subdirectories (such as sdl/ or hardware/). Subdirectories Just Work so go ham! In addition to those points, another important change is that the bin directory is no longer divided into platform subdirectories (Linux64, Mingw, etc). Executables now go directly into bin. If you use DEBUGMODE or target 64-bit, then subdirectories for 'debug' and '64' will be made though. Oh by the way, I don't think make clean actually removed files before on Windows. It should now. I also fixed as many little inconsistencies like that as I noticed. And now just an overview of the technical aspects that shouldn't affect anyone who doesn't REALLY care about the Makefile... objs and dep directories have been moved to a make directory. Makefile.cfg and its variants have been moved out of their various subdirectories to src/Makefile.d make distclean removes the bin and make directories entirely, but make clean and cleandep still only affect the current build target. When I say automation, I mean that a lot of copy pasting in the Makefile has been reduced.
2021-05-02 09:54:51 +00:00
# info - print settings
2014-03-15 16:59:03 +00:00
#
Rewrite Makefile to be modular as well as more automated Some key points for programmers: - Source code files are mostly listed in a 'Sourcefile'. So you no longer directly edit the object list. There can be multiple Sourcefiles and they can even live in subdirectories--the directory name will be prepended to every filename in the list. Of course, the Makefile still needs to be edited to read from each Sourcefile. - Different rules are no longer required for source code files that live in subdirectories (such as sdl/ or hardware/). Subdirectories Just Work so go ham! In addition to those points, another important change is that the bin directory is no longer divided into platform subdirectories (Linux64, Mingw, etc). Executables now go directly into bin. If you use DEBUGMODE or target 64-bit, then subdirectories for 'debug' and '64' will be made though. Oh by the way, I don't think make clean actually removed files before on Windows. It should now. I also fixed as many little inconsistencies like that as I noticed. And now just an overview of the technical aspects that shouldn't affect anyone who doesn't REALLY care about the Makefile... objs and dep directories have been moved to a make directory. Makefile.cfg and its variants have been moved out of their various subdirectories to src/Makefile.d make distclean removes the bin and make directories entirely, but make clean and cleandep still only affect the current build target. When I say automation, I mean that a lot of copy pasting in the Makefile has been reduced.
2021-05-02 09:54:51 +00:00
# This Makefile can automatically detect the host system
# as well as the compiler version. If system or compiler
# version cannot be detected, you may need to set a flag
# manually.
2014-03-15 16:59:03 +00:00
#
Rewrite Makefile to be modular as well as more automated Some key points for programmers: - Source code files are mostly listed in a 'Sourcefile'. So you no longer directly edit the object list. There can be multiple Sourcefiles and they can even live in subdirectories--the directory name will be prepended to every filename in the list. Of course, the Makefile still needs to be edited to read from each Sourcefile. - Different rules are no longer required for source code files that live in subdirectories (such as sdl/ or hardware/). Subdirectories Just Work so go ham! In addition to those points, another important change is that the bin directory is no longer divided into platform subdirectories (Linux64, Mingw, etc). Executables now go directly into bin. If you use DEBUGMODE or target 64-bit, then subdirectories for 'debug' and '64' will be made though. Oh by the way, I don't think make clean actually removed files before on Windows. It should now. I also fixed as many little inconsistencies like that as I noticed. And now just an overview of the technical aspects that shouldn't affect anyone who doesn't REALLY care about the Makefile... objs and dep directories have been moved to a make directory. Makefile.cfg and its variants have been moved out of their various subdirectories to src/Makefile.d make distclean removes the bin and make directories entirely, but make clean and cleandep still only affect the current build target. When I say automation, I mean that a lot of copy pasting in the Makefile has been reduced.
2021-05-02 09:54:51 +00:00
# On Windows machines, 32-bit Windows is always targetted.
2014-03-15 16:59:03 +00:00
#
Rewrite Makefile to be modular as well as more automated Some key points for programmers: - Source code files are mostly listed in a 'Sourcefile'. So you no longer directly edit the object list. There can be multiple Sourcefiles and they can even live in subdirectories--the directory name will be prepended to every filename in the list. Of course, the Makefile still needs to be edited to read from each Sourcefile. - Different rules are no longer required for source code files that live in subdirectories (such as sdl/ or hardware/). Subdirectories Just Work so go ham! In addition to those points, another important change is that the bin directory is no longer divided into platform subdirectories (Linux64, Mingw, etc). Executables now go directly into bin. If you use DEBUGMODE or target 64-bit, then subdirectories for 'debug' and '64' will be made though. Oh by the way, I don't think make clean actually removed files before on Windows. It should now. I also fixed as many little inconsistencies like that as I noticed. And now just an overview of the technical aspects that shouldn't affect anyone who doesn't REALLY care about the Makefile... objs and dep directories have been moved to a make directory. Makefile.cfg and its variants have been moved out of their various subdirectories to src/Makefile.d make distclean removes the bin and make directories entirely, but make clean and cleandep still only affect the current build target. When I say automation, I mean that a lot of copy pasting in the Makefile has been reduced.
2021-05-02 09:54:51 +00:00
# Platform/system flags:
2014-03-15 16:59:03 +00:00
#
Rewrite Makefile to be modular as well as more automated Some key points for programmers: - Source code files are mostly listed in a 'Sourcefile'. So you no longer directly edit the object list. There can be multiple Sourcefiles and they can even live in subdirectories--the directory name will be prepended to every filename in the list. Of course, the Makefile still needs to be edited to read from each Sourcefile. - Different rules are no longer required for source code files that live in subdirectories (such as sdl/ or hardware/). Subdirectories Just Work so go ham! In addition to those points, another important change is that the bin directory is no longer divided into platform subdirectories (Linux64, Mingw, etc). Executables now go directly into bin. If you use DEBUGMODE or target 64-bit, then subdirectories for 'debug' and '64' will be made though. Oh by the way, I don't think make clean actually removed files before on Windows. It should now. I also fixed as many little inconsistencies like that as I noticed. And now just an overview of the technical aspects that shouldn't affect anyone who doesn't REALLY care about the Makefile... objs and dep directories have been moved to a make directory. Makefile.cfg and its variants have been moved out of their various subdirectories to src/Makefile.d make distclean removes the bin and make directories entirely, but make clean and cleandep still only affect the current build target. When I say automation, I mean that a lot of copy pasting in the Makefile has been reduced.
2021-05-02 09:54:51 +00:00
# LINUX=1, LINUX64=1
# MINGW=1, MINGW64=1 - Windows (MinGW toolchain)
# UNIX=1 - Generic Unix like system
# FREEBSD=1
# SDL=1 - Use SDL backend. SDL is the only backend though
# and thus, always enabled.
2014-03-15 16:59:03 +00:00
#
Rewrite Makefile to be modular as well as more automated Some key points for programmers: - Source code files are mostly listed in a 'Sourcefile'. So you no longer directly edit the object list. There can be multiple Sourcefiles and they can even live in subdirectories--the directory name will be prepended to every filename in the list. Of course, the Makefile still needs to be edited to read from each Sourcefile. - Different rules are no longer required for source code files that live in subdirectories (such as sdl/ or hardware/). Subdirectories Just Work so go ham! In addition to those points, another important change is that the bin directory is no longer divided into platform subdirectories (Linux64, Mingw, etc). Executables now go directly into bin. If you use DEBUGMODE or target 64-bit, then subdirectories for 'debug' and '64' will be made though. Oh by the way, I don't think make clean actually removed files before on Windows. It should now. I also fixed as many little inconsistencies like that as I noticed. And now just an overview of the technical aspects that shouldn't affect anyone who doesn't REALLY care about the Makefile... objs and dep directories have been moved to a make directory. Makefile.cfg and its variants have been moved out of their various subdirectories to src/Makefile.d make distclean removes the bin and make directories entirely, but make clean and cleandep still only affect the current build target. When I say automation, I mean that a lot of copy pasting in the Makefile has been reduced.
2021-05-02 09:54:51 +00:00
# A list of supported GCC versions can be found in
# Makefile.d/detect.mk -- search 'gcc_versions'.
#
# Feature flags:
#
# Safe to use online
# ------------------
# NO_IPV6=1 - Disable IPv6 address support.
# NOHW=1 - Disable OpenGL renderer.
# ZDEBUG=1 - Enable more detailed memory debugging
# HAVE_MINIUPNPC=1 - Enable automated port forwarding.
# Already enabled by default for 32-bit
# Windows.
# NOASM=1 - Disable hand optimized assembly code for the
# Software renderer.
# NOPNG=1 - Disable PNG graphics support. (TODO: double
# check netplay compatible.)
# NOCURL=1 - Disable libcurl--HTTP capability.
# NOGME=1 - Disable game music emu, retro VGM support.
# NOOPENMPT=1 - Disable module (tracker) music support.
# NOMIXER=1 - Disable SDL Mixer (audio playback).
# NOMIXERX=1 - Forgo SDL Mixer X--revert to standard SDL
# Mixer. Mixer X is the default for Windows
# builds.
# HAVE_MIXERX=1 - Enable SDL Mixer X. Outside of Windows
# builds, SDL Mixer X is not the default.
# NOTHREADS=1 - Disable multithreading.
#
# Netplay incompatible
# --------------------
# NONET=1 - Disable online capability.
# NOMD5=1 - Disable MD5 checksum (validation tool).
# NOPOSTPROCESSING=1 - ?
# MOBJCONSISTANCY=1 - ??
# PACKETDROP=1 - ??
# DEBUGMODE=1 - Enable various debugging capabilities.
# Also disables optimizations.
# NOZLIB=1 - Disable some compression capability. Implies
# NOPNG=1.
#
# Development flags:
#
# VALGRIND=1 - Enable Valgrind memory debugging support.
# PROFILEMODE=1 - Enable performance profiling (gprof).
#
# General flags for building:
#
# STATIC=1 - Use static linking.
# DISTCC=1
# CCACHE=1
# UPX= - UPX command to use for compressing final
# executable.
Rewrite Makefile to be modular as well as more automated Some key points for programmers: - Source code files are mostly listed in a 'Sourcefile'. So you no longer directly edit the object list. There can be multiple Sourcefiles and they can even live in subdirectories--the directory name will be prepended to every filename in the list. Of course, the Makefile still needs to be edited to read from each Sourcefile. - Different rules are no longer required for source code files that live in subdirectories (such as sdl/ or hardware/). Subdirectories Just Work so go ham! In addition to those points, another important change is that the bin directory is no longer divided into platform subdirectories (Linux64, Mingw, etc). Executables now go directly into bin. If you use DEBUGMODE or target 64-bit, then subdirectories for 'debug' and '64' will be made though. Oh by the way, I don't think make clean actually removed files before on Windows. It should now. I also fixed as many little inconsistencies like that as I noticed. And now just an overview of the technical aspects that shouldn't affect anyone who doesn't REALLY care about the Makefile... objs and dep directories have been moved to a make directory. Makefile.cfg and its variants have been moved out of their various subdirectories to src/Makefile.d make distclean removes the bin and make directories entirely, but make clean and cleandep still only affect the current build target. When I say automation, I mean that a lot of copy pasting in the Makefile has been reduced.
2021-05-02 09:54:51 +00:00
# WINDOWSHELL=1 - Use Windows commands.
# PREFIX= - Prefix to many commands, for cross compiling.
# YASM=1 - Use Yasm instead of NASM assembler.
# STABS=1 - ?
# ECHO=1 - Print out each command in the build process.
# NOECHOFILENAMES=1 - Don't print out each that is being
# worked on.
# SILENT=1 - Print absolutely nothing except errors.
# RELAXWARNINGS=1 - Use less compiler warnings/errors.
# ERRORMODE=1 - Treat most compiler warnings as errors.
# NOCASTALIGNWARN=1 - ?
# NOLDWARNING=1 - ?
# NOSDLMAIN=1 - ?
# SDLMAIN=1 - ?
#
# Library configuration flags:
# Everything here is an override.
#
# PNG_PKGCONFIG= - libpng-config command.
# PNG_CFLAGS=, PNG_LDFLAGS=
#
# CURLCONFIG= - curl-config command.
# CURL_CFLAGS=, CURL_LDFLAGS=
#
# VALGRIND_PKGCONFIG= - pkg-config package name.
# VALGRIND_CFLAGS=, VALGRIND_LDFLAGS=
#
# LIBGME_PKGCONFIG=, LIBGME_CFLAGS=, LIBGME_LDFLAGS=
2014-03-15 16:59:03 +00:00
Rewrite Makefile to be modular as well as more automated Some key points for programmers: - Source code files are mostly listed in a 'Sourcefile'. So you no longer directly edit the object list. There can be multiple Sourcefiles and they can even live in subdirectories--the directory name will be prepended to every filename in the list. Of course, the Makefile still needs to be edited to read from each Sourcefile. - Different rules are no longer required for source code files that live in subdirectories (such as sdl/ or hardware/). Subdirectories Just Work so go ham! In addition to those points, another important change is that the bin directory is no longer divided into platform subdirectories (Linux64, Mingw, etc). Executables now go directly into bin. If you use DEBUGMODE or target 64-bit, then subdirectories for 'debug' and '64' will be made though. Oh by the way, I don't think make clean actually removed files before on Windows. It should now. I also fixed as many little inconsistencies like that as I noticed. And now just an overview of the technical aspects that shouldn't affect anyone who doesn't REALLY care about the Makefile... objs and dep directories have been moved to a make directory. Makefile.cfg and its variants have been moved out of their various subdirectories to src/Makefile.d make distclean removes the bin and make directories entirely, but make clean and cleandep still only affect the current build target. When I say automation, I mean that a lot of copy pasting in the Makefile has been reduced.
2021-05-02 09:54:51 +00:00
# LIBOPENMPT_PKGCONFIG=
# LIBOPENMPT_CFLAGS=, LIBOPENMPT_LDFLAGS=
#
# ZLIB_PKGCONFIG=, ZLIB_CFLAGS=, ZLIB_LDFLAGS=
#
# SDL_PKGCONFIG=
# SDL_CONFIG= - sdl-config command.
# SDL_CFLAGS=, SDL_LDFLAGS=
2014-03-15 16:59:03 +00:00
Rewrite Makefile to be modular as well as more automated Some key points for programmers: - Source code files are mostly listed in a 'Sourcefile'. So you no longer directly edit the object list. There can be multiple Sourcefiles and they can even live in subdirectories--the directory name will be prepended to every filename in the list. Of course, the Makefile still needs to be edited to read from each Sourcefile. - Different rules are no longer required for source code files that live in subdirectories (such as sdl/ or hardware/). Subdirectories Just Work so go ham! In addition to those points, another important change is that the bin directory is no longer divided into platform subdirectories (Linux64, Mingw, etc). Executables now go directly into bin. If you use DEBUGMODE or target 64-bit, then subdirectories for 'debug' and '64' will be made though. Oh by the way, I don't think make clean actually removed files before on Windows. It should now. I also fixed as many little inconsistencies like that as I noticed. And now just an overview of the technical aspects that shouldn't affect anyone who doesn't REALLY care about the Makefile... objs and dep directories have been moved to a make directory. Makefile.cfg and its variants have been moved out of their various subdirectories to src/Makefile.d make distclean removes the bin and make directories entirely, but make clean and cleandep still only affect the current build target. When I say automation, I mean that a lot of copy pasting in the Makefile has been reduced.
2021-05-02 09:54:51 +00:00
clean_targets=cleandep clean distclean info
2014-03-15 16:59:03 +00:00
Rewrite Makefile to be modular as well as more automated Some key points for programmers: - Source code files are mostly listed in a 'Sourcefile'. So you no longer directly edit the object list. There can be multiple Sourcefiles and they can even live in subdirectories--the directory name will be prepended to every filename in the list. Of course, the Makefile still needs to be edited to read from each Sourcefile. - Different rules are no longer required for source code files that live in subdirectories (such as sdl/ or hardware/). Subdirectories Just Work so go ham! In addition to those points, another important change is that the bin directory is no longer divided into platform subdirectories (Linux64, Mingw, etc). Executables now go directly into bin. If you use DEBUGMODE or target 64-bit, then subdirectories for 'debug' and '64' will be made though. Oh by the way, I don't think make clean actually removed files before on Windows. It should now. I also fixed as many little inconsistencies like that as I noticed. And now just an overview of the technical aspects that shouldn't affect anyone who doesn't REALLY care about the Makefile... objs and dep directories have been moved to a make directory. Makefile.cfg and its variants have been moved out of their various subdirectories to src/Makefile.d make distclean removes the bin and make directories entirely, but make clean and cleandep still only affect the current build target. When I say automation, I mean that a lot of copy pasting in the Makefile has been reduced.
2021-05-02 09:54:51 +00:00
.PHONY : $(clean_targets) all
Rewrite Makefile to be modular as well as more automated Some key points for programmers: - Source code files are mostly listed in a 'Sourcefile'. So you no longer directly edit the object list. There can be multiple Sourcefiles and they can even live in subdirectories--the directory name will be prepended to every filename in the list. Of course, the Makefile still needs to be edited to read from each Sourcefile. - Different rules are no longer required for source code files that live in subdirectories (such as sdl/ or hardware/). Subdirectories Just Work so go ham! In addition to those points, another important change is that the bin directory is no longer divided into platform subdirectories (Linux64, Mingw, etc). Executables now go directly into bin. If you use DEBUGMODE or target 64-bit, then subdirectories for 'debug' and '64' will be made though. Oh by the way, I don't think make clean actually removed files before on Windows. It should now. I also fixed as many little inconsistencies like that as I noticed. And now just an overview of the technical aspects that shouldn't affect anyone who doesn't REALLY care about the Makefile... objs and dep directories have been moved to a make directory. Makefile.cfg and its variants have been moved out of their various subdirectories to src/Makefile.d make distclean removes the bin and make directories entirely, but make clean and cleandep still only affect the current build target. When I say automation, I mean that a lot of copy pasting in the Makefile has been reduced.
2021-05-02 09:54:51 +00:00
goals:=$(or $(MAKECMDGOALS),all)
cleanonly:=$(filter $(clean_targets),$(goals))
destructive:=$(filter-out info,$(cleanonly))
2014-03-15 16:59:03 +00:00
Rewrite Makefile to be modular as well as more automated Some key points for programmers: - Source code files are mostly listed in a 'Sourcefile'. So you no longer directly edit the object list. There can be multiple Sourcefiles and they can even live in subdirectories--the directory name will be prepended to every filename in the list. Of course, the Makefile still needs to be edited to read from each Sourcefile. - Different rules are no longer required for source code files that live in subdirectories (such as sdl/ or hardware/). Subdirectories Just Work so go ham! In addition to those points, another important change is that the bin directory is no longer divided into platform subdirectories (Linux64, Mingw, etc). Executables now go directly into bin. If you use DEBUGMODE or target 64-bit, then subdirectories for 'debug' and '64' will be made though. Oh by the way, I don't think make clean actually removed files before on Windows. It should now. I also fixed as many little inconsistencies like that as I noticed. And now just an overview of the technical aspects that shouldn't affect anyone who doesn't REALLY care about the Makefile... objs and dep directories have been moved to a make directory. Makefile.cfg and its variants have been moved out of their various subdirectories to src/Makefile.d make distclean removes the bin and make directories entirely, but make clean and cleandep still only affect the current build target. When I say automation, I mean that a lot of copy pasting in the Makefile has been reduced.
2021-05-02 09:54:51 +00:00
include Makefile.d/util.mk
2014-03-15 16:59:03 +00:00
Rewrite Makefile to be modular as well as more automated Some key points for programmers: - Source code files are mostly listed in a 'Sourcefile'. So you no longer directly edit the object list. There can be multiple Sourcefiles and they can even live in subdirectories--the directory name will be prepended to every filename in the list. Of course, the Makefile still needs to be edited to read from each Sourcefile. - Different rules are no longer required for source code files that live in subdirectories (such as sdl/ or hardware/). Subdirectories Just Work so go ham! In addition to those points, another important change is that the bin directory is no longer divided into platform subdirectories (Linux64, Mingw, etc). Executables now go directly into bin. If you use DEBUGMODE or target 64-bit, then subdirectories for 'debug' and '64' will be made though. Oh by the way, I don't think make clean actually removed files before on Windows. It should now. I also fixed as many little inconsistencies like that as I noticed. And now just an overview of the technical aspects that shouldn't affect anyone who doesn't REALLY care about the Makefile... objs and dep directories have been moved to a make directory. Makefile.cfg and its variants have been moved out of their various subdirectories to src/Makefile.d make distclean removes the bin and make directories entirely, but make clean and cleandep still only affect the current build target. When I say automation, I mean that a lot of copy pasting in the Makefile has been reduced.
2021-05-02 09:54:51 +00:00
ifdef PREFIX
CC:=$(PREFIX)-gcc
2014-03-15 16:59:03 +00:00
endif
Rewrite Makefile to be modular as well as more automated Some key points for programmers: - Source code files are mostly listed in a 'Sourcefile'. So you no longer directly edit the object list. There can be multiple Sourcefiles and they can even live in subdirectories--the directory name will be prepended to every filename in the list. Of course, the Makefile still needs to be edited to read from each Sourcefile. - Different rules are no longer required for source code files that live in subdirectories (such as sdl/ or hardware/). Subdirectories Just Work so go ham! In addition to those points, another important change is that the bin directory is no longer divided into platform subdirectories (Linux64, Mingw, etc). Executables now go directly into bin. If you use DEBUGMODE or target 64-bit, then subdirectories for 'debug' and '64' will be made though. Oh by the way, I don't think make clean actually removed files before on Windows. It should now. I also fixed as many little inconsistencies like that as I noticed. And now just an overview of the technical aspects that shouldn't affect anyone who doesn't REALLY care about the Makefile... objs and dep directories have been moved to a make directory. Makefile.cfg and its variants have been moved out of their various subdirectories to src/Makefile.d make distclean removes the bin and make directories entirely, but make clean and cleandep still only affect the current build target. When I say automation, I mean that a lot of copy pasting in the Makefile has been reduced.
2021-05-02 09:54:51 +00:00
OBJDUMP_OPTS?=--wide --source --line-numbers
2014-03-15 16:59:03 +00:00
Rewrite Makefile to be modular as well as more automated Some key points for programmers: - Source code files are mostly listed in a 'Sourcefile'. So you no longer directly edit the object list. There can be multiple Sourcefiles and they can even live in subdirectories--the directory name will be prepended to every filename in the list. Of course, the Makefile still needs to be edited to read from each Sourcefile. - Different rules are no longer required for source code files that live in subdirectories (such as sdl/ or hardware/). Subdirectories Just Work so go ham! In addition to those points, another important change is that the bin directory is no longer divided into platform subdirectories (Linux64, Mingw, etc). Executables now go directly into bin. If you use DEBUGMODE or target 64-bit, then subdirectories for 'debug' and '64' will be made though. Oh by the way, I don't think make clean actually removed files before on Windows. It should now. I also fixed as many little inconsistencies like that as I noticed. And now just an overview of the technical aspects that shouldn't affect anyone who doesn't REALLY care about the Makefile... objs and dep directories have been moved to a make directory. Makefile.cfg and its variants have been moved out of their various subdirectories to src/Makefile.d make distclean removes the bin and make directories entirely, but make clean and cleandep still only affect the current build target. When I say automation, I mean that a lot of copy pasting in the Makefile has been reduced.
2021-05-02 09:54:51 +00:00
OBJCOPY:=$(call Prefix,objcopy)
OBJDUMP:=$(call Prefix,objdump) $(OBJDUMP_OPTS)
WINDRES:=$(call Prefix,windres)
2014-03-15 16:59:03 +00:00
Rewrite Makefile to be modular as well as more automated Some key points for programmers: - Source code files are mostly listed in a 'Sourcefile'. So you no longer directly edit the object list. There can be multiple Sourcefiles and they can even live in subdirectories--the directory name will be prepended to every filename in the list. Of course, the Makefile still needs to be edited to read from each Sourcefile. - Different rules are no longer required for source code files that live in subdirectories (such as sdl/ or hardware/). Subdirectories Just Work so go ham! In addition to those points, another important change is that the bin directory is no longer divided into platform subdirectories (Linux64, Mingw, etc). Executables now go directly into bin. If you use DEBUGMODE or target 64-bit, then subdirectories for 'debug' and '64' will be made though. Oh by the way, I don't think make clean actually removed files before on Windows. It should now. I also fixed as many little inconsistencies like that as I noticed. And now just an overview of the technical aspects that shouldn't affect anyone who doesn't REALLY care about the Makefile... objs and dep directories have been moved to a make directory. Makefile.cfg and its variants have been moved out of their various subdirectories to src/Makefile.d make distclean removes the bin and make directories entirely, but make clean and cleandep still only affect the current build target. When I say automation, I mean that a lot of copy pasting in the Makefile has been reduced.
2021-05-02 09:54:51 +00:00
ifdef YASM
NASM?=yasm
else
NASM?=nasm
endif
Rewrite Makefile to be modular as well as more automated Some key points for programmers: - Source code files are mostly listed in a 'Sourcefile'. So you no longer directly edit the object list. There can be multiple Sourcefiles and they can even live in subdirectories--the directory name will be prepended to every filename in the list. Of course, the Makefile still needs to be edited to read from each Sourcefile. - Different rules are no longer required for source code files that live in subdirectories (such as sdl/ or hardware/). Subdirectories Just Work so go ham! In addition to those points, another important change is that the bin directory is no longer divided into platform subdirectories (Linux64, Mingw, etc). Executables now go directly into bin. If you use DEBUGMODE or target 64-bit, then subdirectories for 'debug' and '64' will be made though. Oh by the way, I don't think make clean actually removed files before on Windows. It should now. I also fixed as many little inconsistencies like that as I noticed. And now just an overview of the technical aspects that shouldn't affect anyone who doesn't REALLY care about the Makefile... objs and dep directories have been moved to a make directory. Makefile.cfg and its variants have been moved out of their various subdirectories to src/Makefile.d make distclean removes the bin and make directories entirely, but make clean and cleandep still only affect the current build target. When I say automation, I mean that a lot of copy pasting in the Makefile has been reduced.
2021-05-02 09:54:51 +00:00
ifdef YASM
ifdef STABS
NASMOPTS?=-g stabs
else
NASMOPTS?=-g dwarf2
2014-03-15 16:59:03 +00:00
endif
Rewrite Makefile to be modular as well as more automated Some key points for programmers: - Source code files are mostly listed in a 'Sourcefile'. So you no longer directly edit the object list. There can be multiple Sourcefiles and they can even live in subdirectories--the directory name will be prepended to every filename in the list. Of course, the Makefile still needs to be edited to read from each Sourcefile. - Different rules are no longer required for source code files that live in subdirectories (such as sdl/ or hardware/). Subdirectories Just Work so go ham! In addition to those points, another important change is that the bin directory is no longer divided into platform subdirectories (Linux64, Mingw, etc). Executables now go directly into bin. If you use DEBUGMODE or target 64-bit, then subdirectories for 'debug' and '64' will be made though. Oh by the way, I don't think make clean actually removed files before on Windows. It should now. I also fixed as many little inconsistencies like that as I noticed. And now just an overview of the technical aspects that shouldn't affect anyone who doesn't REALLY care about the Makefile... objs and dep directories have been moved to a make directory. Makefile.cfg and its variants have been moved out of their various subdirectories to src/Makefile.d make distclean removes the bin and make directories entirely, but make clean and cleandep still only affect the current build target. When I say automation, I mean that a lot of copy pasting in the Makefile has been reduced.
2021-05-02 09:54:51 +00:00
else
NASMOPTS?=-g
2014-03-15 16:59:03 +00:00
endif
Rewrite Makefile to be modular as well as more automated Some key points for programmers: - Source code files are mostly listed in a 'Sourcefile'. So you no longer directly edit the object list. There can be multiple Sourcefiles and they can even live in subdirectories--the directory name will be prepended to every filename in the list. Of course, the Makefile still needs to be edited to read from each Sourcefile. - Different rules are no longer required for source code files that live in subdirectories (such as sdl/ or hardware/). Subdirectories Just Work so go ham! In addition to those points, another important change is that the bin directory is no longer divided into platform subdirectories (Linux64, Mingw, etc). Executables now go directly into bin. If you use DEBUGMODE or target 64-bit, then subdirectories for 'debug' and '64' will be made though. Oh by the way, I don't think make clean actually removed files before on Windows. It should now. I also fixed as many little inconsistencies like that as I noticed. And now just an overview of the technical aspects that shouldn't affect anyone who doesn't REALLY care about the Makefile... objs and dep directories have been moved to a make directory. Makefile.cfg and its variants have been moved out of their various subdirectories to src/Makefile.d make distclean removes the bin and make directories entirely, but make clean and cleandep still only affect the current build target. When I say automation, I mean that a lot of copy pasting in the Makefile has been reduced.
2021-05-02 09:54:51 +00:00
GZIP?=gzip
GZIP_OPTS?=-9 -f -n
ifdef WINDOWSHELL
Rewrite Makefile to be modular as well as more automated Some key points for programmers: - Source code files are mostly listed in a 'Sourcefile'. So you no longer directly edit the object list. There can be multiple Sourcefiles and they can even live in subdirectories--the directory name will be prepended to every filename in the list. Of course, the Makefile still needs to be edited to read from each Sourcefile. - Different rules are no longer required for source code files that live in subdirectories (such as sdl/ or hardware/). Subdirectories Just Work so go ham! In addition to those points, another important change is that the bin directory is no longer divided into platform subdirectories (Linux64, Mingw, etc). Executables now go directly into bin. If you use DEBUGMODE or target 64-bit, then subdirectories for 'debug' and '64' will be made though. Oh by the way, I don't think make clean actually removed files before on Windows. It should now. I also fixed as many little inconsistencies like that as I noticed. And now just an overview of the technical aspects that shouldn't affect anyone who doesn't REALLY care about the Makefile... objs and dep directories have been moved to a make directory. Makefile.cfg and its variants have been moved out of their various subdirectories to src/Makefile.d make distclean removes the bin and make directories entirely, but make clean and cleandep still only affect the current build target. When I say automation, I mean that a lot of copy pasting in the Makefile has been reduced.
2021-05-02 09:54:51 +00:00
GZIP_OPTS+=--rsyncable
endif
Rewrite Makefile to be modular as well as more automated Some key points for programmers: - Source code files are mostly listed in a 'Sourcefile'. So you no longer directly edit the object list. There can be multiple Sourcefiles and they can even live in subdirectories--the directory name will be prepended to every filename in the list. Of course, the Makefile still needs to be edited to read from each Sourcefile. - Different rules are no longer required for source code files that live in subdirectories (such as sdl/ or hardware/). Subdirectories Just Work so go ham! In addition to those points, another important change is that the bin directory is no longer divided into platform subdirectories (Linux64, Mingw, etc). Executables now go directly into bin. If you use DEBUGMODE or target 64-bit, then subdirectories for 'debug' and '64' will be made though. Oh by the way, I don't think make clean actually removed files before on Windows. It should now. I also fixed as many little inconsistencies like that as I noticed. And now just an overview of the technical aspects that shouldn't affect anyone who doesn't REALLY care about the Makefile... objs and dep directories have been moved to a make directory. Makefile.cfg and its variants have been moved out of their various subdirectories to src/Makefile.d make distclean removes the bin and make directories entirely, but make clean and cleandep still only affect the current build target. When I say automation, I mean that a lot of copy pasting in the Makefile has been reduced.
2021-05-02 09:54:51 +00:00
UPX_OPTS?=--best --preserve-build-id
2014-03-15 16:59:03 +00:00
ifndef ECHO
Rewrite Makefile to be modular as well as more automated Some key points for programmers: - Source code files are mostly listed in a 'Sourcefile'. So you no longer directly edit the object list. There can be multiple Sourcefiles and they can even live in subdirectories--the directory name will be prepended to every filename in the list. Of course, the Makefile still needs to be edited to read from each Sourcefile. - Different rules are no longer required for source code files that live in subdirectories (such as sdl/ or hardware/). Subdirectories Just Work so go ham! In addition to those points, another important change is that the bin directory is no longer divided into platform subdirectories (Linux64, Mingw, etc). Executables now go directly into bin. If you use DEBUGMODE or target 64-bit, then subdirectories for 'debug' and '64' will be made though. Oh by the way, I don't think make clean actually removed files before on Windows. It should now. I also fixed as many little inconsistencies like that as I noticed. And now just an overview of the technical aspects that shouldn't affect anyone who doesn't REALLY care about the Makefile... objs and dep directories have been moved to a make directory. Makefile.cfg and its variants have been moved out of their various subdirectories to src/Makefile.d make distclean removes the bin and make directories entirely, but make clean and cleandep still only affect the current build target. When I say automation, I mean that a lot of copy pasting in the Makefile has been reduced.
2021-05-02 09:54:51 +00:00
UPX_OPTS+=-qq
2014-03-15 16:59:03 +00:00
endif
Rewrite Makefile to be modular as well as more automated Some key points for programmers: - Source code files are mostly listed in a 'Sourcefile'. So you no longer directly edit the object list. There can be multiple Sourcefiles and they can even live in subdirectories--the directory name will be prepended to every filename in the list. Of course, the Makefile still needs to be edited to read from each Sourcefile. - Different rules are no longer required for source code files that live in subdirectories (such as sdl/ or hardware/). Subdirectories Just Work so go ham! In addition to those points, another important change is that the bin directory is no longer divided into platform subdirectories (Linux64, Mingw, etc). Executables now go directly into bin. If you use DEBUGMODE or target 64-bit, then subdirectories for 'debug' and '64' will be made though. Oh by the way, I don't think make clean actually removed files before on Windows. It should now. I also fixed as many little inconsistencies like that as I noticed. And now just an overview of the technical aspects that shouldn't affect anyone who doesn't REALLY care about the Makefile... objs and dep directories have been moved to a make directory. Makefile.cfg and its variants have been moved out of their various subdirectories to src/Makefile.d make distclean removes the bin and make directories entirely, but make clean and cleandep still only affect the current build target. When I say automation, I mean that a lot of copy pasting in the Makefile has been reduced.
2021-05-02 09:54:51 +00:00
include Makefile.d/detect.mk
2014-03-15 16:59:03 +00:00
Rewrite Makefile to be modular as well as more automated Some key points for programmers: - Source code files are mostly listed in a 'Sourcefile'. So you no longer directly edit the object list. There can be multiple Sourcefiles and they can even live in subdirectories--the directory name will be prepended to every filename in the list. Of course, the Makefile still needs to be edited to read from each Sourcefile. - Different rules are no longer required for source code files that live in subdirectories (such as sdl/ or hardware/). Subdirectories Just Work so go ham! In addition to those points, another important change is that the bin directory is no longer divided into platform subdirectories (Linux64, Mingw, etc). Executables now go directly into bin. If you use DEBUGMODE or target 64-bit, then subdirectories for 'debug' and '64' will be made though. Oh by the way, I don't think make clean actually removed files before on Windows. It should now. I also fixed as many little inconsistencies like that as I noticed. And now just an overview of the technical aspects that shouldn't affect anyone who doesn't REALLY care about the Makefile... objs and dep directories have been moved to a make directory. Makefile.cfg and its variants have been moved out of their various subdirectories to src/Makefile.d make distclean removes the bin and make directories entirely, but make clean and cleandep still only affect the current build target. When I say automation, I mean that a lot of copy pasting in the Makefile has been reduced.
2021-05-02 09:54:51 +00:00
# make would try to remove the implicitly made directories
.PRECIOUS : %/ comptime.c
2014-03-15 16:59:03 +00:00
Rewrite Makefile to be modular as well as more automated Some key points for programmers: - Source code files are mostly listed in a 'Sourcefile'. So you no longer directly edit the object list. There can be multiple Sourcefiles and they can even live in subdirectories--the directory name will be prepended to every filename in the list. Of course, the Makefile still needs to be edited to read from each Sourcefile. - Different rules are no longer required for source code files that live in subdirectories (such as sdl/ or hardware/). Subdirectories Just Work so go ham! In addition to those points, another important change is that the bin directory is no longer divided into platform subdirectories (Linux64, Mingw, etc). Executables now go directly into bin. If you use DEBUGMODE or target 64-bit, then subdirectories for 'debug' and '64' will be made though. Oh by the way, I don't think make clean actually removed files before on Windows. It should now. I also fixed as many little inconsistencies like that as I noticed. And now just an overview of the technical aspects that shouldn't affect anyone who doesn't REALLY care about the Makefile... objs and dep directories have been moved to a make directory. Makefile.cfg and its variants have been moved out of their various subdirectories to src/Makefile.d make distclean removes the bin and make directories entirely, but make clean and cleandep still only affect the current build target. When I say automation, I mean that a lot of copy pasting in the Makefile has been reduced.
2021-05-02 09:54:51 +00:00
# very sophisticated dependency
sources:=\
$(call List,Sourcefile)\
$(call List,blua/Sourcefile)\
2014-03-15 16:59:03 +00:00
Rewrite Makefile to be modular as well as more automated Some key points for programmers: - Source code files are mostly listed in a 'Sourcefile'. So you no longer directly edit the object list. There can be multiple Sourcefiles and they can even live in subdirectories--the directory name will be prepended to every filename in the list. Of course, the Makefile still needs to be edited to read from each Sourcefile. - Different rules are no longer required for source code files that live in subdirectories (such as sdl/ or hardware/). Subdirectories Just Work so go ham! In addition to those points, another important change is that the bin directory is no longer divided into platform subdirectories (Linux64, Mingw, etc). Executables now go directly into bin. If you use DEBUGMODE or target 64-bit, then subdirectories for 'debug' and '64' will be made though. Oh by the way, I don't think make clean actually removed files before on Windows. It should now. I also fixed as many little inconsistencies like that as I noticed. And now just an overview of the technical aspects that shouldn't affect anyone who doesn't REALLY care about the Makefile... objs and dep directories have been moved to a make directory. Makefile.cfg and its variants have been moved out of their various subdirectories to src/Makefile.d make distclean removes the bin and make directories entirely, but make clean and cleandep still only affect the current build target. When I say automation, I mean that a lot of copy pasting in the Makefile has been reduced.
2021-05-02 09:54:51 +00:00
makedir:=../make
2014-03-15 16:59:03 +00:00
Rewrite Makefile to be modular as well as more automated Some key points for programmers: - Source code files are mostly listed in a 'Sourcefile'. So you no longer directly edit the object list. There can be multiple Sourcefiles and they can even live in subdirectories--the directory name will be prepended to every filename in the list. Of course, the Makefile still needs to be edited to read from each Sourcefile. - Different rules are no longer required for source code files that live in subdirectories (such as sdl/ or hardware/). Subdirectories Just Work so go ham! In addition to those points, another important change is that the bin directory is no longer divided into platform subdirectories (Linux64, Mingw, etc). Executables now go directly into bin. If you use DEBUGMODE or target 64-bit, then subdirectories for 'debug' and '64' will be made though. Oh by the way, I don't think make clean actually removed files before on Windows. It should now. I also fixed as many little inconsistencies like that as I noticed. And now just an overview of the technical aspects that shouldn't affect anyone who doesn't REALLY care about the Makefile... objs and dep directories have been moved to a make directory. Makefile.cfg and its variants have been moved out of their various subdirectories to src/Makefile.d make distclean removes the bin and make directories entirely, but make clean and cleandep still only affect the current build target. When I say automation, I mean that a lot of copy pasting in the Makefile has been reduced.
2021-05-02 09:54:51 +00:00
# -DCOMPVERSION: flag to use comptime.h
opts:=-DCOMPVERSION -g
libs:=
2014-03-15 16:59:03 +00:00
Rewrite Makefile to be modular as well as more automated Some key points for programmers: - Source code files are mostly listed in a 'Sourcefile'. So you no longer directly edit the object list. There can be multiple Sourcefiles and they can even live in subdirectories--the directory name will be prepended to every filename in the list. Of course, the Makefile still needs to be edited to read from each Sourcefile. - Different rules are no longer required for source code files that live in subdirectories (such as sdl/ or hardware/). Subdirectories Just Work so go ham! In addition to those points, another important change is that the bin directory is no longer divided into platform subdirectories (Linux64, Mingw, etc). Executables now go directly into bin. If you use DEBUGMODE or target 64-bit, then subdirectories for 'debug' and '64' will be made though. Oh by the way, I don't think make clean actually removed files before on Windows. It should now. I also fixed as many little inconsistencies like that as I noticed. And now just an overview of the technical aspects that shouldn't affect anyone who doesn't REALLY care about the Makefile... objs and dep directories have been moved to a make directory. Makefile.cfg and its variants have been moved out of their various subdirectories to src/Makefile.d make distclean removes the bin and make directories entirely, but make clean and cleandep still only affect the current build target. When I say automation, I mean that a lot of copy pasting in the Makefile has been reduced.
2021-05-02 09:54:51 +00:00
nasm_format:=
2014-03-15 16:59:03 +00:00
Rewrite Makefile to be modular as well as more automated Some key points for programmers: - Source code files are mostly listed in a 'Sourcefile'. So you no longer directly edit the object list. There can be multiple Sourcefiles and they can even live in subdirectories--the directory name will be prepended to every filename in the list. Of course, the Makefile still needs to be edited to read from each Sourcefile. - Different rules are no longer required for source code files that live in subdirectories (such as sdl/ or hardware/). Subdirectories Just Work so go ham! In addition to those points, another important change is that the bin directory is no longer divided into platform subdirectories (Linux64, Mingw, etc). Executables now go directly into bin. If you use DEBUGMODE or target 64-bit, then subdirectories for 'debug' and '64' will be made though. Oh by the way, I don't think make clean actually removed files before on Windows. It should now. I also fixed as many little inconsistencies like that as I noticed. And now just an overview of the technical aspects that shouldn't affect anyone who doesn't REALLY care about the Makefile... objs and dep directories have been moved to a make directory. Makefile.cfg and its variants have been moved out of their various subdirectories to src/Makefile.d make distclean removes the bin and make directories entirely, but make clean and cleandep still only affect the current build target. When I say automation, I mean that a lot of copy pasting in the Makefile has been reduced.
2021-05-02 09:54:51 +00:00
# This is a list of variables names, of which if defined,
# also defines the name as a macro to the compiler.
passthru_opts:=
2014-03-15 16:59:03 +00:00
Rewrite Makefile to be modular as well as more automated Some key points for programmers: - Source code files are mostly listed in a 'Sourcefile'. So you no longer directly edit the object list. There can be multiple Sourcefiles and they can even live in subdirectories--the directory name will be prepended to every filename in the list. Of course, the Makefile still needs to be edited to read from each Sourcefile. - Different rules are no longer required for source code files that live in subdirectories (such as sdl/ or hardware/). Subdirectories Just Work so go ham! In addition to those points, another important change is that the bin directory is no longer divided into platform subdirectories (Linux64, Mingw, etc). Executables now go directly into bin. If you use DEBUGMODE or target 64-bit, then subdirectories for 'debug' and '64' will be made though. Oh by the way, I don't think make clean actually removed files before on Windows. It should now. I also fixed as many little inconsistencies like that as I noticed. And now just an overview of the technical aspects that shouldn't affect anyone who doesn't REALLY care about the Makefile... objs and dep directories have been moved to a make directory. Makefile.cfg and its variants have been moved out of their various subdirectories to src/Makefile.d make distclean removes the bin and make directories entirely, but make clean and cleandep still only affect the current build target. When I say automation, I mean that a lot of copy pasting in the Makefile has been reduced.
2021-05-02 09:54:51 +00:00
include Makefile.d/platform.mk
include Makefile.d/features.mk
include Makefile.d/versions.mk
Rewrite Makefile to be modular as well as more automated Some key points for programmers: - Source code files are mostly listed in a 'Sourcefile'. So you no longer directly edit the object list. There can be multiple Sourcefiles and they can even live in subdirectories--the directory name will be prepended to every filename in the list. Of course, the Makefile still needs to be edited to read from each Sourcefile. - Different rules are no longer required for source code files that live in subdirectories (such as sdl/ or hardware/). Subdirectories Just Work so go ham! In addition to those points, another important change is that the bin directory is no longer divided into platform subdirectories (Linux64, Mingw, etc). Executables now go directly into bin. If you use DEBUGMODE or target 64-bit, then subdirectories for 'debug' and '64' will be made though. Oh by the way, I don't think make clean actually removed files before on Windows. It should now. I also fixed as many little inconsistencies like that as I noticed. And now just an overview of the technical aspects that shouldn't affect anyone who doesn't REALLY care about the Makefile... objs and dep directories have been moved to a make directory. Makefile.cfg and its variants have been moved out of their various subdirectories to src/Makefile.d make distclean removes the bin and make directories entirely, but make clean and cleandep still only affect the current build target. When I say automation, I mean that a lot of copy pasting in the Makefile has been reduced.
2021-05-02 09:54:51 +00:00
ifdef DEBUGMODE
makedir:=$(makedir)/debug
2014-03-15 16:59:03 +00:00
endif
Rewrite Makefile to be modular as well as more automated Some key points for programmers: - Source code files are mostly listed in a 'Sourcefile'. So you no longer directly edit the object list. There can be multiple Sourcefiles and they can even live in subdirectories--the directory name will be prepended to every filename in the list. Of course, the Makefile still needs to be edited to read from each Sourcefile. - Different rules are no longer required for source code files that live in subdirectories (such as sdl/ or hardware/). Subdirectories Just Work so go ham! In addition to those points, another important change is that the bin directory is no longer divided into platform subdirectories (Linux64, Mingw, etc). Executables now go directly into bin. If you use DEBUGMODE or target 64-bit, then subdirectories for 'debug' and '64' will be made though. Oh by the way, I don't think make clean actually removed files before on Windows. It should now. I also fixed as many little inconsistencies like that as I noticed. And now just an overview of the technical aspects that shouldn't affect anyone who doesn't REALLY care about the Makefile... objs and dep directories have been moved to a make directory. Makefile.cfg and its variants have been moved out of their various subdirectories to src/Makefile.d make distclean removes the bin and make directories entirely, but make clean and cleandep still only affect the current build target. When I say automation, I mean that a lot of copy pasting in the Makefile has been reduced.
2021-05-02 09:54:51 +00:00
depdir:=$(makedir)/deps
objdir:=$(makedir)/objs
2014-03-15 16:59:03 +00:00
Rewrite Makefile to be modular as well as more automated Some key points for programmers: - Source code files are mostly listed in a 'Sourcefile'. So you no longer directly edit the object list. There can be multiple Sourcefiles and they can even live in subdirectories--the directory name will be prepended to every filename in the list. Of course, the Makefile still needs to be edited to read from each Sourcefile. - Different rules are no longer required for source code files that live in subdirectories (such as sdl/ or hardware/). Subdirectories Just Work so go ham! In addition to those points, another important change is that the bin directory is no longer divided into platform subdirectories (Linux64, Mingw, etc). Executables now go directly into bin. If you use DEBUGMODE or target 64-bit, then subdirectories for 'debug' and '64' will be made though. Oh by the way, I don't think make clean actually removed files before on Windows. It should now. I also fixed as many little inconsistencies like that as I noticed. And now just an overview of the technical aspects that shouldn't affect anyone who doesn't REALLY care about the Makefile... objs and dep directories have been moved to a make directory. Makefile.cfg and its variants have been moved out of their various subdirectories to src/Makefile.d make distclean removes the bin and make directories entirely, but make clean and cleandep still only affect the current build target. When I say automation, I mean that a lot of copy pasting in the Makefile has been reduced.
2021-05-02 09:54:51 +00:00
depends:=$(basename $(filter %.c %.s,$(sources)))
objects:=$(basename $(filter %.c %.s %.nas,$(sources)))
2014-03-15 16:59:03 +00:00
Rewrite Makefile to be modular as well as more automated Some key points for programmers: - Source code files are mostly listed in a 'Sourcefile'. So you no longer directly edit the object list. There can be multiple Sourcefiles and they can even live in subdirectories--the directory name will be prepended to every filename in the list. Of course, the Makefile still needs to be edited to read from each Sourcefile. - Different rules are no longer required for source code files that live in subdirectories (such as sdl/ or hardware/). Subdirectories Just Work so go ham! In addition to those points, another important change is that the bin directory is no longer divided into platform subdirectories (Linux64, Mingw, etc). Executables now go directly into bin. If you use DEBUGMODE or target 64-bit, then subdirectories for 'debug' and '64' will be made though. Oh by the way, I don't think make clean actually removed files before on Windows. It should now. I also fixed as many little inconsistencies like that as I noticed. And now just an overview of the technical aspects that shouldn't affect anyone who doesn't REALLY care about the Makefile... objs and dep directories have been moved to a make directory. Makefile.cfg and its variants have been moved out of their various subdirectories to src/Makefile.d make distclean removes the bin and make directories entirely, but make clean and cleandep still only affect the current build target. When I say automation, I mean that a lot of copy pasting in the Makefile has been reduced.
2021-05-02 09:54:51 +00:00
depends:=$(depends:%=$(depdir)/%.d)
2014-03-15 16:59:03 +00:00
Rewrite Makefile to be modular as well as more automated Some key points for programmers: - Source code files are mostly listed in a 'Sourcefile'. So you no longer directly edit the object list. There can be multiple Sourcefiles and they can even live in subdirectories--the directory name will be prepended to every filename in the list. Of course, the Makefile still needs to be edited to read from each Sourcefile. - Different rules are no longer required for source code files that live in subdirectories (such as sdl/ or hardware/). Subdirectories Just Work so go ham! In addition to those points, another important change is that the bin directory is no longer divided into platform subdirectories (Linux64, Mingw, etc). Executables now go directly into bin. If you use DEBUGMODE or target 64-bit, then subdirectories for 'debug' and '64' will be made though. Oh by the way, I don't think make clean actually removed files before on Windows. It should now. I also fixed as many little inconsistencies like that as I noticed. And now just an overview of the technical aspects that shouldn't affect anyone who doesn't REALLY care about the Makefile... objs and dep directories have been moved to a make directory. Makefile.cfg and its variants have been moved out of their various subdirectories to src/Makefile.d make distclean removes the bin and make directories entirely, but make clean and cleandep still only affect the current build target. When I say automation, I mean that a lot of copy pasting in the Makefile has been reduced.
2021-05-02 09:54:51 +00:00
# comptime.o added directly to objects instead of thru
# sources because comptime.c includes comptime.h, but
# comptime.h may not exist yet. It's a headache so this is
# easier.
objects:=$(objects:=.o) comptime.o
Rewrite Makefile to be modular as well as more automated Some key points for programmers: - Source code files are mostly listed in a 'Sourcefile'. So you no longer directly edit the object list. There can be multiple Sourcefiles and they can even live in subdirectories--the directory name will be prepended to every filename in the list. Of course, the Makefile still needs to be edited to read from each Sourcefile. - Different rules are no longer required for source code files that live in subdirectories (such as sdl/ or hardware/). Subdirectories Just Work so go ham! In addition to those points, another important change is that the bin directory is no longer divided into platform subdirectories (Linux64, Mingw, etc). Executables now go directly into bin. If you use DEBUGMODE or target 64-bit, then subdirectories for 'debug' and '64' will be made though. Oh by the way, I don't think make clean actually removed files before on Windows. It should now. I also fixed as many little inconsistencies like that as I noticed. And now just an overview of the technical aspects that shouldn't affect anyone who doesn't REALLY care about the Makefile... objs and dep directories have been moved to a make directory. Makefile.cfg and its variants have been moved out of their various subdirectories to src/Makefile.d make distclean removes the bin and make directories entirely, but make clean and cleandep still only affect the current build target. When I say automation, I mean that a lot of copy pasting in the Makefile has been reduced.
2021-05-02 09:54:51 +00:00
# windows resource file
rc_file:=$(basename $(filter %.rc,$(sources)))
ifdef rc_file
objects+=$(rc_file:=.res)
endif
Rewrite Makefile to be modular as well as more automated Some key points for programmers: - Source code files are mostly listed in a 'Sourcefile'. So you no longer directly edit the object list. There can be multiple Sourcefiles and they can even live in subdirectories--the directory name will be prepended to every filename in the list. Of course, the Makefile still needs to be edited to read from each Sourcefile. - Different rules are no longer required for source code files that live in subdirectories (such as sdl/ or hardware/). Subdirectories Just Work so go ham! In addition to those points, another important change is that the bin directory is no longer divided into platform subdirectories (Linux64, Mingw, etc). Executables now go directly into bin. If you use DEBUGMODE or target 64-bit, then subdirectories for 'debug' and '64' will be made though. Oh by the way, I don't think make clean actually removed files before on Windows. It should now. I also fixed as many little inconsistencies like that as I noticed. And now just an overview of the technical aspects that shouldn't affect anyone who doesn't REALLY care about the Makefile... objs and dep directories have been moved to a make directory. Makefile.cfg and its variants have been moved out of their various subdirectories to src/Makefile.d make distclean removes the bin and make directories entirely, but make clean and cleandep still only affect the current build target. When I say automation, I mean that a lot of copy pasting in the Makefile has been reduced.
2021-05-02 09:54:51 +00:00
objects:=$(addprefix $(objdir)/,$(objects))
2018-10-04 23:47:19 +00:00
Rewrite Makefile to be modular as well as more automated Some key points for programmers: - Source code files are mostly listed in a 'Sourcefile'. So you no longer directly edit the object list. There can be multiple Sourcefiles and they can even live in subdirectories--the directory name will be prepended to every filename in the list. Of course, the Makefile still needs to be edited to read from each Sourcefile. - Different rules are no longer required for source code files that live in subdirectories (such as sdl/ or hardware/). Subdirectories Just Work so go ham! In addition to those points, another important change is that the bin directory is no longer divided into platform subdirectories (Linux64, Mingw, etc). Executables now go directly into bin. If you use DEBUGMODE or target 64-bit, then subdirectories for 'debug' and '64' will be made though. Oh by the way, I don't think make clean actually removed files before on Windows. It should now. I also fixed as many little inconsistencies like that as I noticed. And now just an overview of the technical aspects that shouldn't affect anyone who doesn't REALLY care about the Makefile... objs and dep directories have been moved to a make directory. Makefile.cfg and its variants have been moved out of their various subdirectories to src/Makefile.d make distclean removes the bin and make directories entirely, but make clean and cleandep still only affect the current build target. When I say automation, I mean that a lot of copy pasting in the Makefile has been reduced.
2021-05-02 09:54:51 +00:00
ifdef DEBUGMODE
bin:=../bin/debug
2018-10-04 23:47:19 +00:00
else
Rewrite Makefile to be modular as well as more automated Some key points for programmers: - Source code files are mostly listed in a 'Sourcefile'. So you no longer directly edit the object list. There can be multiple Sourcefiles and they can even live in subdirectories--the directory name will be prepended to every filename in the list. Of course, the Makefile still needs to be edited to read from each Sourcefile. - Different rules are no longer required for source code files that live in subdirectories (such as sdl/ or hardware/). Subdirectories Just Work so go ham! In addition to those points, another important change is that the bin directory is no longer divided into platform subdirectories (Linux64, Mingw, etc). Executables now go directly into bin. If you use DEBUGMODE or target 64-bit, then subdirectories for 'debug' and '64' will be made though. Oh by the way, I don't think make clean actually removed files before on Windows. It should now. I also fixed as many little inconsistencies like that as I noticed. And now just an overview of the technical aspects that shouldn't affect anyone who doesn't REALLY care about the Makefile... objs and dep directories have been moved to a make directory. Makefile.cfg and its variants have been moved out of their various subdirectories to src/Makefile.d make distclean removes the bin and make directories entirely, but make clean and cleandep still only affect the current build target. When I say automation, I mean that a lot of copy pasting in the Makefile has been reduced.
2021-05-02 09:54:51 +00:00
bin:=../bin
2018-10-04 23:47:19 +00:00
endif
Rewrite Makefile to be modular as well as more automated Some key points for programmers: - Source code files are mostly listed in a 'Sourcefile'. So you no longer directly edit the object list. There can be multiple Sourcefiles and they can even live in subdirectories--the directory name will be prepended to every filename in the list. Of course, the Makefile still needs to be edited to read from each Sourcefile. - Different rules are no longer required for source code files that live in subdirectories (such as sdl/ or hardware/). Subdirectories Just Work so go ham! In addition to those points, another important change is that the bin directory is no longer divided into platform subdirectories (Linux64, Mingw, etc). Executables now go directly into bin. If you use DEBUGMODE or target 64-bit, then subdirectories for 'debug' and '64' will be made though. Oh by the way, I don't think make clean actually removed files before on Windows. It should now. I also fixed as many little inconsistencies like that as I noticed. And now just an overview of the technical aspects that shouldn't affect anyone who doesn't REALLY care about the Makefile... objs and dep directories have been moved to a make directory. Makefile.cfg and its variants have been moved out of their various subdirectories to src/Makefile.d make distclean removes the bin and make directories entirely, but make clean and cleandep still only affect the current build target. When I say automation, I mean that a lot of copy pasting in the Makefile has been reduced.
2021-05-02 09:54:51 +00:00
# default EXENAME (usually set by platform)
EXENAME?=srb2
DBGNAME?=$(EXENAME).debug
Rewrite Makefile to be modular as well as more automated Some key points for programmers: - Source code files are mostly listed in a 'Sourcefile'. So you no longer directly edit the object list. There can be multiple Sourcefiles and they can even live in subdirectories--the directory name will be prepended to every filename in the list. Of course, the Makefile still needs to be edited to read from each Sourcefile. - Different rules are no longer required for source code files that live in subdirectories (such as sdl/ or hardware/). Subdirectories Just Work so go ham! In addition to those points, another important change is that the bin directory is no longer divided into platform subdirectories (Linux64, Mingw, etc). Executables now go directly into bin. If you use DEBUGMODE or target 64-bit, then subdirectories for 'debug' and '64' will be made though. Oh by the way, I don't think make clean actually removed files before on Windows. It should now. I also fixed as many little inconsistencies like that as I noticed. And now just an overview of the technical aspects that shouldn't affect anyone who doesn't REALLY care about the Makefile... objs and dep directories have been moved to a make directory. Makefile.cfg and its variants have been moved out of their various subdirectories to src/Makefile.d make distclean removes the bin and make directories entirely, but make clean and cleandep still only affect the current build target. When I say automation, I mean that a lot of copy pasting in the Makefile has been reduced.
2021-05-02 09:54:51 +00:00
exe:=$(bin)/$(EXENAME)
dbg:=$(bin)/$(DBGNAME)
2014-03-15 16:59:03 +00:00
build_done==== Build is done, look for \
2021-06-16 23:58:47 +00:00
$(<F) at $(abspath $(<D)) ===
2014-03-15 16:59:03 +00:00
Rewrite Makefile to be modular as well as more automated Some key points for programmers: - Source code files are mostly listed in a 'Sourcefile'. So you no longer directly edit the object list. There can be multiple Sourcefiles and they can even live in subdirectories--the directory name will be prepended to every filename in the list. Of course, the Makefile still needs to be edited to read from each Sourcefile. - Different rules are no longer required for source code files that live in subdirectories (such as sdl/ or hardware/). Subdirectories Just Work so go ham! In addition to those points, another important change is that the bin directory is no longer divided into platform subdirectories (Linux64, Mingw, etc). Executables now go directly into bin. If you use DEBUGMODE or target 64-bit, then subdirectories for 'debug' and '64' will be made though. Oh by the way, I don't think make clean actually removed files before on Windows. It should now. I also fixed as many little inconsistencies like that as I noticed. And now just an overview of the technical aspects that shouldn't affect anyone who doesn't REALLY care about the Makefile... objs and dep directories have been moved to a make directory. Makefile.cfg and its variants have been moved out of their various subdirectories to src/Makefile.d make distclean removes the bin and make directories entirely, but make clean and cleandep still only affect the current build target. When I say automation, I mean that a lot of copy pasting in the Makefile has been reduced.
2021-05-02 09:54:51 +00:00
all : $(exe)
$(call Echo,$(build_done))
2014-03-15 16:59:03 +00:00
Rewrite Makefile to be modular as well as more automated Some key points for programmers: - Source code files are mostly listed in a 'Sourcefile'. So you no longer directly edit the object list. There can be multiple Sourcefiles and they can even live in subdirectories--the directory name will be prepended to every filename in the list. Of course, the Makefile still needs to be edited to read from each Sourcefile. - Different rules are no longer required for source code files that live in subdirectories (such as sdl/ or hardware/). Subdirectories Just Work so go ham! In addition to those points, another important change is that the bin directory is no longer divided into platform subdirectories (Linux64, Mingw, etc). Executables now go directly into bin. If you use DEBUGMODE or target 64-bit, then subdirectories for 'debug' and '64' will be made though. Oh by the way, I don't think make clean actually removed files before on Windows. It should now. I also fixed as many little inconsistencies like that as I noticed. And now just an overview of the technical aspects that shouldn't affect anyone who doesn't REALLY care about the Makefile... objs and dep directories have been moved to a make directory. Makefile.cfg and its variants have been moved out of their various subdirectories to src/Makefile.d make distclean removes the bin and make directories entirely, but make clean and cleandep still only affect the current build target. When I say automation, I mean that a lot of copy pasting in the Makefile has been reduced.
2021-05-02 09:54:51 +00:00
ifndef VALGRIND
dump : $(dbg).txt
2014-03-15 16:59:03 +00:00
endif
Rewrite Makefile to be modular as well as more automated Some key points for programmers: - Source code files are mostly listed in a 'Sourcefile'. So you no longer directly edit the object list. There can be multiple Sourcefiles and they can even live in subdirectories--the directory name will be prepended to every filename in the list. Of course, the Makefile still needs to be edited to read from each Sourcefile. - Different rules are no longer required for source code files that live in subdirectories (such as sdl/ or hardware/). Subdirectories Just Work so go ham! In addition to those points, another important change is that the bin directory is no longer divided into platform subdirectories (Linux64, Mingw, etc). Executables now go directly into bin. If you use DEBUGMODE or target 64-bit, then subdirectories for 'debug' and '64' will be made though. Oh by the way, I don't think make clean actually removed files before on Windows. It should now. I also fixed as many little inconsistencies like that as I noticed. And now just an overview of the technical aspects that shouldn't affect anyone who doesn't REALLY care about the Makefile... objs and dep directories have been moved to a make directory. Makefile.cfg and its variants have been moved out of their various subdirectories to src/Makefile.d make distclean removes the bin and make directories entirely, but make clean and cleandep still only affect the current build target. When I say automation, I mean that a lot of copy pasting in the Makefile has been reduced.
2021-05-02 09:54:51 +00:00
ifdef STATIC
libs+=-static
endif
Rewrite Makefile to be modular as well as more automated Some key points for programmers: - Source code files are mostly listed in a 'Sourcefile'. So you no longer directly edit the object list. There can be multiple Sourcefiles and they can even live in subdirectories--the directory name will be prepended to every filename in the list. Of course, the Makefile still needs to be edited to read from each Sourcefile. - Different rules are no longer required for source code files that live in subdirectories (such as sdl/ or hardware/). Subdirectories Just Work so go ham! In addition to those points, another important change is that the bin directory is no longer divided into platform subdirectories (Linux64, Mingw, etc). Executables now go directly into bin. If you use DEBUGMODE or target 64-bit, then subdirectories for 'debug' and '64' will be made though. Oh by the way, I don't think make clean actually removed files before on Windows. It should now. I also fixed as many little inconsistencies like that as I noticed. And now just an overview of the technical aspects that shouldn't affect anyone who doesn't REALLY care about the Makefile... objs and dep directories have been moved to a make directory. Makefile.cfg and its variants have been moved out of their various subdirectories to src/Makefile.d make distclean removes the bin and make directories entirely, but make clean and cleandep still only affect the current build target. When I say automation, I mean that a lot of copy pasting in the Makefile has been reduced.
2021-05-02 09:54:51 +00:00
# build with profiling information
ifdef PROFILEMODE
opts+=-pg
libs+=-pg
endif
2014-03-15 16:59:03 +00:00
ifdef DEBUGMODE
Rewrite Makefile to be modular as well as more automated Some key points for programmers: - Source code files are mostly listed in a 'Sourcefile'. So you no longer directly edit the object list. There can be multiple Sourcefiles and they can even live in subdirectories--the directory name will be prepended to every filename in the list. Of course, the Makefile still needs to be edited to read from each Sourcefile. - Different rules are no longer required for source code files that live in subdirectories (such as sdl/ or hardware/). Subdirectories Just Work so go ham! In addition to those points, another important change is that the bin directory is no longer divided into platform subdirectories (Linux64, Mingw, etc). Executables now go directly into bin. If you use DEBUGMODE or target 64-bit, then subdirectories for 'debug' and '64' will be made though. Oh by the way, I don't think make clean actually removed files before on Windows. It should now. I also fixed as many little inconsistencies like that as I noticed. And now just an overview of the technical aspects that shouldn't affect anyone who doesn't REALLY care about the Makefile... objs and dep directories have been moved to a make directory. Makefile.cfg and its variants have been moved out of their various subdirectories to src/Makefile.d make distclean removes the bin and make directories entirely, but make clean and cleandep still only affect the current build target. When I say automation, I mean that a lot of copy pasting in the Makefile has been reduced.
2021-05-02 09:54:51 +00:00
debug_opts=-D_DEBUG
else # build a normal optimized version
debug_opts=-DNDEBUG
opts+=-O3
endif
2014-03-15 16:59:03 +00:00
Rewrite Makefile to be modular as well as more automated Some key points for programmers: - Source code files are mostly listed in a 'Sourcefile'. So you no longer directly edit the object list. There can be multiple Sourcefiles and they can even live in subdirectories--the directory name will be prepended to every filename in the list. Of course, the Makefile still needs to be edited to read from each Sourcefile. - Different rules are no longer required for source code files that live in subdirectories (such as sdl/ or hardware/). Subdirectories Just Work so go ham! In addition to those points, another important change is that the bin directory is no longer divided into platform subdirectories (Linux64, Mingw, etc). Executables now go directly into bin. If you use DEBUGMODE or target 64-bit, then subdirectories for 'debug' and '64' will be made though. Oh by the way, I don't think make clean actually removed files before on Windows. It should now. I also fixed as many little inconsistencies like that as I noticed. And now just an overview of the technical aspects that shouldn't affect anyone who doesn't REALLY care about the Makefile... objs and dep directories have been moved to a make directory. Makefile.cfg and its variants have been moved out of their various subdirectories to src/Makefile.d make distclean removes the bin and make directories entirely, but make clean and cleandep still only affect the current build target. When I say automation, I mean that a lot of copy pasting in the Makefile has been reduced.
2021-05-02 09:54:51 +00:00
# debug_opts also get passed to windres
opts+=$(debug_opts)
2014-03-15 16:59:03 +00:00
Rewrite Makefile to be modular as well as more automated Some key points for programmers: - Source code files are mostly listed in a 'Sourcefile'. So you no longer directly edit the object list. There can be multiple Sourcefiles and they can even live in subdirectories--the directory name will be prepended to every filename in the list. Of course, the Makefile still needs to be edited to read from each Sourcefile. - Different rules are no longer required for source code files that live in subdirectories (such as sdl/ or hardware/). Subdirectories Just Work so go ham! In addition to those points, another important change is that the bin directory is no longer divided into platform subdirectories (Linux64, Mingw, etc). Executables now go directly into bin. If you use DEBUGMODE or target 64-bit, then subdirectories for 'debug' and '64' will be made though. Oh by the way, I don't think make clean actually removed files before on Windows. It should now. I also fixed as many little inconsistencies like that as I noticed. And now just an overview of the technical aspects that shouldn't affect anyone who doesn't REALLY care about the Makefile... objs and dep directories have been moved to a make directory. Makefile.cfg and its variants have been moved out of their various subdirectories to src/Makefile.d make distclean removes the bin and make directories entirely, but make clean and cleandep still only affect the current build target. When I say automation, I mean that a lot of copy pasting in the Makefile has been reduced.
2021-05-02 09:54:51 +00:00
opts+=$(foreach v,$(passthru_opts),$(if $($(v)),-D$(v)))
2014-03-15 16:59:03 +00:00
Rewrite Makefile to be modular as well as more automated Some key points for programmers: - Source code files are mostly listed in a 'Sourcefile'. So you no longer directly edit the object list. There can be multiple Sourcefiles and they can even live in subdirectories--the directory name will be prepended to every filename in the list. Of course, the Makefile still needs to be edited to read from each Sourcefile. - Different rules are no longer required for source code files that live in subdirectories (such as sdl/ or hardware/). Subdirectories Just Work so go ham! In addition to those points, another important change is that the bin directory is no longer divided into platform subdirectories (Linux64, Mingw, etc). Executables now go directly into bin. If you use DEBUGMODE or target 64-bit, then subdirectories for 'debug' and '64' will be made though. Oh by the way, I don't think make clean actually removed files before on Windows. It should now. I also fixed as many little inconsistencies like that as I noticed. And now just an overview of the technical aspects that shouldn't affect anyone who doesn't REALLY care about the Makefile... objs and dep directories have been moved to a make directory. Makefile.cfg and its variants have been moved out of their various subdirectories to src/Makefile.d make distclean removes the bin and make directories entirely, but make clean and cleandep still only affect the current build target. When I say automation, I mean that a lot of copy pasting in the Makefile has been reduced.
2021-05-02 09:54:51 +00:00
CFLAGS:=$(opts) $(WFLAGS) $(CPPFLAGS) $(CFLAGS)
LDFLAGS:=$(libs) $(LDFLAGS)
ASFLAGS+=-x assembler-with-cpp
2014-03-15 16:59:03 +00:00
Rewrite Makefile to be modular as well as more automated Some key points for programmers: - Source code files are mostly listed in a 'Sourcefile'. So you no longer directly edit the object list. There can be multiple Sourcefiles and they can even live in subdirectories--the directory name will be prepended to every filename in the list. Of course, the Makefile still needs to be edited to read from each Sourcefile. - Different rules are no longer required for source code files that live in subdirectories (such as sdl/ or hardware/). Subdirectories Just Work so go ham! In addition to those points, another important change is that the bin directory is no longer divided into platform subdirectories (Linux64, Mingw, etc). Executables now go directly into bin. If you use DEBUGMODE or target 64-bit, then subdirectories for 'debug' and '64' will be made though. Oh by the way, I don't think make clean actually removed files before on Windows. It should now. I also fixed as many little inconsistencies like that as I noticed. And now just an overview of the technical aspects that shouldn't affect anyone who doesn't REALLY care about the Makefile... objs and dep directories have been moved to a make directory. Makefile.cfg and its variants have been moved out of their various subdirectories to src/Makefile.d make distclean removes the bin and make directories entirely, but make clean and cleandep still only affect the current build target. When I say automation, I mean that a lot of copy pasting in the Makefile has been reduced.
2021-05-02 09:54:51 +00:00
ifdef DISTCC
CC:=distcc $(CC)
2014-03-15 16:59:03 +00:00
endif
Rewrite Makefile to be modular as well as more automated Some key points for programmers: - Source code files are mostly listed in a 'Sourcefile'. So you no longer directly edit the object list. There can be multiple Sourcefiles and they can even live in subdirectories--the directory name will be prepended to every filename in the list. Of course, the Makefile still needs to be edited to read from each Sourcefile. - Different rules are no longer required for source code files that live in subdirectories (such as sdl/ or hardware/). Subdirectories Just Work so go ham! In addition to those points, another important change is that the bin directory is no longer divided into platform subdirectories (Linux64, Mingw, etc). Executables now go directly into bin. If you use DEBUGMODE or target 64-bit, then subdirectories for 'debug' and '64' will be made though. Oh by the way, I don't think make clean actually removed files before on Windows. It should now. I also fixed as many little inconsistencies like that as I noticed. And now just an overview of the technical aspects that shouldn't affect anyone who doesn't REALLY care about the Makefile... objs and dep directories have been moved to a make directory. Makefile.cfg and its variants have been moved out of their various subdirectories to src/Makefile.d make distclean removes the bin and make directories entirely, but make clean and cleandep still only affect the current build target. When I say automation, I mean that a lot of copy pasting in the Makefile has been reduced.
2021-05-02 09:54:51 +00:00
ifdef CCACHE
CC:=ccache $(CC)
2014-03-15 16:59:03 +00:00
endif
ifndef SILENT
Rewrite Makefile to be modular as well as more automated Some key points for programmers: - Source code files are mostly listed in a 'Sourcefile'. So you no longer directly edit the object list. There can be multiple Sourcefiles and they can even live in subdirectories--the directory name will be prepended to every filename in the list. Of course, the Makefile still needs to be edited to read from each Sourcefile. - Different rules are no longer required for source code files that live in subdirectories (such as sdl/ or hardware/). Subdirectories Just Work so go ham! In addition to those points, another important change is that the bin directory is no longer divided into platform subdirectories (Linux64, Mingw, etc). Executables now go directly into bin. If you use DEBUGMODE or target 64-bit, then subdirectories for 'debug' and '64' will be made though. Oh by the way, I don't think make clean actually removed files before on Windows. It should now. I also fixed as many little inconsistencies like that as I noticed. And now just an overview of the technical aspects that shouldn't affect anyone who doesn't REALLY care about the Makefile... objs and dep directories have been moved to a make directory. Makefile.cfg and its variants have been moved out of their various subdirectories to src/Makefile.d make distclean removes the bin and make directories entirely, but make clean and cleandep still only affect the current build target. When I say automation, I mean that a lot of copy pasting in the Makefile has been reduced.
2021-05-02 09:54:51 +00:00
# makefile will 'restart' when it finishes including the
# dependencies.
ifndef MAKE_RESTARTS
2021-05-04 23:54:47 +00:00
ifndef destructive
Rewrite Makefile to be modular as well as more automated Some key points for programmers: - Source code files are mostly listed in a 'Sourcefile'. So you no longer directly edit the object list. There can be multiple Sourcefiles and they can even live in subdirectories--the directory name will be prepended to every filename in the list. Of course, the Makefile still needs to be edited to read from each Sourcefile. - Different rules are no longer required for source code files that live in subdirectories (such as sdl/ or hardware/). Subdirectories Just Work so go ham! In addition to those points, another important change is that the bin directory is no longer divided into platform subdirectories (Linux64, Mingw, etc). Executables now go directly into bin. If you use DEBUGMODE or target 64-bit, then subdirectories for 'debug' and '64' will be made though. Oh by the way, I don't think make clean actually removed files before on Windows. It should now. I also fixed as many little inconsistencies like that as I noticed. And now just an overview of the technical aspects that shouldn't affect anyone who doesn't REALLY care about the Makefile... objs and dep directories have been moved to a make directory. Makefile.cfg and its variants have been moved out of their various subdirectories to src/Makefile.d make distclean removes the bin and make directories entirely, but make clean and cleandep still only affect the current build target. When I say automation, I mean that a lot of copy pasting in the Makefile has been reduced.
2021-05-02 09:54:51 +00:00
$(shell $(CC) -v)
define flags =
Rewrite Makefile to be modular as well as more automated Some key points for programmers: - Source code files are mostly listed in a 'Sourcefile'. So you no longer directly edit the object list. There can be multiple Sourcefiles and they can even live in subdirectories--the directory name will be prepended to every filename in the list. Of course, the Makefile still needs to be edited to read from each Sourcefile. - Different rules are no longer required for source code files that live in subdirectories (such as sdl/ or hardware/). Subdirectories Just Work so go ham! In addition to those points, another important change is that the bin directory is no longer divided into platform subdirectories (Linux64, Mingw, etc). Executables now go directly into bin. If you use DEBUGMODE or target 64-bit, then subdirectories for 'debug' and '64' will be made though. Oh by the way, I don't think make clean actually removed files before on Windows. It should now. I also fixed as many little inconsistencies like that as I noticed. And now just an overview of the technical aspects that shouldn't affect anyone who doesn't REALLY care about the Makefile... objs and dep directories have been moved to a make directory. Makefile.cfg and its variants have been moved out of their various subdirectories to src/Makefile.d make distclean removes the bin and make directories entirely, but make clean and cleandep still only affect the current build target. When I say automation, I mean that a lot of copy pasting in the Makefile has been reduced.
2021-05-02 09:54:51 +00:00
CC ........ $(CC)
2014-03-15 16:59:03 +00:00
Rewrite Makefile to be modular as well as more automated Some key points for programmers: - Source code files are mostly listed in a 'Sourcefile'. So you no longer directly edit the object list. There can be multiple Sourcefiles and they can even live in subdirectories--the directory name will be prepended to every filename in the list. Of course, the Makefile still needs to be edited to read from each Sourcefile. - Different rules are no longer required for source code files that live in subdirectories (such as sdl/ or hardware/). Subdirectories Just Work so go ham! In addition to those points, another important change is that the bin directory is no longer divided into platform subdirectories (Linux64, Mingw, etc). Executables now go directly into bin. If you use DEBUGMODE or target 64-bit, then subdirectories for 'debug' and '64' will be made though. Oh by the way, I don't think make clean actually removed files before on Windows. It should now. I also fixed as many little inconsistencies like that as I noticed. And now just an overview of the technical aspects that shouldn't affect anyone who doesn't REALLY care about the Makefile... objs and dep directories have been moved to a make directory. Makefile.cfg and its variants have been moved out of their various subdirectories to src/Makefile.d make distclean removes the bin and make directories entirely, but make clean and cleandep still only affect the current build target. When I say automation, I mean that a lot of copy pasting in the Makefile has been reduced.
2021-05-02 09:54:51 +00:00
CFLAGS .... $(CFLAGS)
2014-03-15 16:59:03 +00:00
Rewrite Makefile to be modular as well as more automated Some key points for programmers: - Source code files are mostly listed in a 'Sourcefile'. So you no longer directly edit the object list. There can be multiple Sourcefiles and they can even live in subdirectories--the directory name will be prepended to every filename in the list. Of course, the Makefile still needs to be edited to read from each Sourcefile. - Different rules are no longer required for source code files that live in subdirectories (such as sdl/ or hardware/). Subdirectories Just Work so go ham! In addition to those points, another important change is that the bin directory is no longer divided into platform subdirectories (Linux64, Mingw, etc). Executables now go directly into bin. If you use DEBUGMODE or target 64-bit, then subdirectories for 'debug' and '64' will be made though. Oh by the way, I don't think make clean actually removed files before on Windows. It should now. I also fixed as many little inconsistencies like that as I noticed. And now just an overview of the technical aspects that shouldn't affect anyone who doesn't REALLY care about the Makefile... objs and dep directories have been moved to a make directory. Makefile.cfg and its variants have been moved out of their various subdirectories to src/Makefile.d make distclean removes the bin and make directories entirely, but make clean and cleandep still only affect the current build target. When I say automation, I mean that a lot of copy pasting in the Makefile has been reduced.
2021-05-02 09:54:51 +00:00
LDFLAGS ... $(LDFLAGS)
2014-03-15 16:59:03 +00:00
Rewrite Makefile to be modular as well as more automated Some key points for programmers: - Source code files are mostly listed in a 'Sourcefile'. So you no longer directly edit the object list. There can be multiple Sourcefiles and they can even live in subdirectories--the directory name will be prepended to every filename in the list. Of course, the Makefile still needs to be edited to read from each Sourcefile. - Different rules are no longer required for source code files that live in subdirectories (such as sdl/ or hardware/). Subdirectories Just Work so go ham! In addition to those points, another important change is that the bin directory is no longer divided into platform subdirectories (Linux64, Mingw, etc). Executables now go directly into bin. If you use DEBUGMODE or target 64-bit, then subdirectories for 'debug' and '64' will be made though. Oh by the way, I don't think make clean actually removed files before on Windows. It should now. I also fixed as many little inconsistencies like that as I noticed. And now just an overview of the technical aspects that shouldn't affect anyone who doesn't REALLY care about the Makefile... objs and dep directories have been moved to a make directory. Makefile.cfg and its variants have been moved out of their various subdirectories to src/Makefile.d make distclean removes the bin and make directories entirely, but make clean and cleandep still only affect the current build target. When I say automation, I mean that a lot of copy pasting in the Makefile has been reduced.
2021-05-02 09:54:51 +00:00
endef
$(info $(flags))
2014-03-15 16:59:03 +00:00
endif
Rewrite Makefile to be modular as well as more automated Some key points for programmers: - Source code files are mostly listed in a 'Sourcefile'. So you no longer directly edit the object list. There can be multiple Sourcefiles and they can even live in subdirectories--the directory name will be prepended to every filename in the list. Of course, the Makefile still needs to be edited to read from each Sourcefile. - Different rules are no longer required for source code files that live in subdirectories (such as sdl/ or hardware/). Subdirectories Just Work so go ham! In addition to those points, another important change is that the bin directory is no longer divided into platform subdirectories (Linux64, Mingw, etc). Executables now go directly into bin. If you use DEBUGMODE or target 64-bit, then subdirectories for 'debug' and '64' will be made though. Oh by the way, I don't think make clean actually removed files before on Windows. It should now. I also fixed as many little inconsistencies like that as I noticed. And now just an overview of the technical aspects that shouldn't affect anyone who doesn't REALLY care about the Makefile... objs and dep directories have been moved to a make directory. Makefile.cfg and its variants have been moved out of their various subdirectories to src/Makefile.d make distclean removes the bin and make directories entirely, but make clean and cleandep still only affect the current build target. When I say automation, I mean that a lot of copy pasting in the Makefile has been reduced.
2021-05-02 09:54:51 +00:00
# don't generate dependency files if only cleaning
ifndef cleanonly
$(info Checking dependency files...)
include $(depends)
2014-03-15 16:59:03 +00:00
endif
endif
endif
Rewrite Makefile to be modular as well as more automated Some key points for programmers: - Source code files are mostly listed in a 'Sourcefile'. So you no longer directly edit the object list. There can be multiple Sourcefiles and they can even live in subdirectories--the directory name will be prepended to every filename in the list. Of course, the Makefile still needs to be edited to read from each Sourcefile. - Different rules are no longer required for source code files that live in subdirectories (such as sdl/ or hardware/). Subdirectories Just Work so go ham! In addition to those points, another important change is that the bin directory is no longer divided into platform subdirectories (Linux64, Mingw, etc). Executables now go directly into bin. If you use DEBUGMODE or target 64-bit, then subdirectories for 'debug' and '64' will be made though. Oh by the way, I don't think make clean actually removed files before on Windows. It should now. I also fixed as many little inconsistencies like that as I noticed. And now just an overview of the technical aspects that shouldn't affect anyone who doesn't REALLY care about the Makefile... objs and dep directories have been moved to a make directory. Makefile.cfg and its variants have been moved out of their various subdirectories to src/Makefile.d make distclean removes the bin and make directories entirely, but make clean and cleandep still only affect the current build target. When I say automation, I mean that a lot of copy pasting in the Makefile has been reduced.
2021-05-02 09:54:51 +00:00
LD:=$(CC)
CC:=$(CC) $(CFLAGS)
NASM:=$(NASM) $(NASMOPTS) -f $(nasm_format)
GZIP:=$(GZIP) $(GZIP_OPTS)
ifdef UPX
Rewrite Makefile to be modular as well as more automated Some key points for programmers: - Source code files are mostly listed in a 'Sourcefile'. So you no longer directly edit the object list. There can be multiple Sourcefiles and they can even live in subdirectories--the directory name will be prepended to every filename in the list. Of course, the Makefile still needs to be edited to read from each Sourcefile. - Different rules are no longer required for source code files that live in subdirectories (such as sdl/ or hardware/). Subdirectories Just Work so go ham! In addition to those points, another important change is that the bin directory is no longer divided into platform subdirectories (Linux64, Mingw, etc). Executables now go directly into bin. If you use DEBUGMODE or target 64-bit, then subdirectories for 'debug' and '64' will be made though. Oh by the way, I don't think make clean actually removed files before on Windows. It should now. I also fixed as many little inconsistencies like that as I noticed. And now just an overview of the technical aspects that shouldn't affect anyone who doesn't REALLY care about the Makefile... objs and dep directories have been moved to a make directory. Makefile.cfg and its variants have been moved out of their various subdirectories to src/Makefile.d make distclean removes the bin and make directories entirely, but make clean and cleandep still only affect the current build target. When I say automation, I mean that a lot of copy pasting in the Makefile has been reduced.
2021-05-02 09:54:51 +00:00
UPX:=$(UPX) $(UPX_OPTS)
endif
Rewrite Makefile to be modular as well as more automated Some key points for programmers: - Source code files are mostly listed in a 'Sourcefile'. So you no longer directly edit the object list. There can be multiple Sourcefiles and they can even live in subdirectories--the directory name will be prepended to every filename in the list. Of course, the Makefile still needs to be edited to read from each Sourcefile. - Different rules are no longer required for source code files that live in subdirectories (such as sdl/ or hardware/). Subdirectories Just Work so go ham! In addition to those points, another important change is that the bin directory is no longer divided into platform subdirectories (Linux64, Mingw, etc). Executables now go directly into bin. If you use DEBUGMODE or target 64-bit, then subdirectories for 'debug' and '64' will be made though. Oh by the way, I don't think make clean actually removed files before on Windows. It should now. I also fixed as many little inconsistencies like that as I noticed. And now just an overview of the technical aspects that shouldn't affect anyone who doesn't REALLY care about the Makefile... objs and dep directories have been moved to a make directory. Makefile.cfg and its variants have been moved out of their various subdirectories to src/Makefile.d make distclean removes the bin and make directories entirely, but make clean and cleandep still only affect the current build target. When I say automation, I mean that a lot of copy pasting in the Makefile has been reduced.
2021-05-02 09:54:51 +00:00
WINDRES:=$(WINDRES) $(WINDRESFLAGS)\
$(debug_opts) --include-dir=win32 -O coff
2014-03-15 16:59:03 +00:00
Rewrite Makefile to be modular as well as more automated Some key points for programmers: - Source code files are mostly listed in a 'Sourcefile'. So you no longer directly edit the object list. There can be multiple Sourcefiles and they can even live in subdirectories--the directory name will be prepended to every filename in the list. Of course, the Makefile still needs to be edited to read from each Sourcefile. - Different rules are no longer required for source code files that live in subdirectories (such as sdl/ or hardware/). Subdirectories Just Work so go ham! In addition to those points, another important change is that the bin directory is no longer divided into platform subdirectories (Linux64, Mingw, etc). Executables now go directly into bin. If you use DEBUGMODE or target 64-bit, then subdirectories for 'debug' and '64' will be made though. Oh by the way, I don't think make clean actually removed files before on Windows. It should now. I also fixed as many little inconsistencies like that as I noticed. And now just an overview of the technical aspects that shouldn't affect anyone who doesn't REALLY care about the Makefile... objs and dep directories have been moved to a make directory. Makefile.cfg and its variants have been moved out of their various subdirectories to src/Makefile.d make distclean removes the bin and make directories entirely, but make clean and cleandep still only affect the current build target. When I say automation, I mean that a lot of copy pasting in the Makefile has been reduced.
2021-05-02 09:54:51 +00:00
%/ :
$(.)$(mkdir) $(call Windows_path,$@)
2014-03-15 16:59:03 +00:00
Rewrite Makefile to be modular as well as more automated Some key points for programmers: - Source code files are mostly listed in a 'Sourcefile'. So you no longer directly edit the object list. There can be multiple Sourcefiles and they can even live in subdirectories--the directory name will be prepended to every filename in the list. Of course, the Makefile still needs to be edited to read from each Sourcefile. - Different rules are no longer required for source code files that live in subdirectories (such as sdl/ or hardware/). Subdirectories Just Work so go ham! In addition to those points, another important change is that the bin directory is no longer divided into platform subdirectories (Linux64, Mingw, etc). Executables now go directly into bin. If you use DEBUGMODE or target 64-bit, then subdirectories for 'debug' and '64' will be made though. Oh by the way, I don't think make clean actually removed files before on Windows. It should now. I also fixed as many little inconsistencies like that as I noticed. And now just an overview of the technical aspects that shouldn't affect anyone who doesn't REALLY care about the Makefile... objs and dep directories have been moved to a make directory. Makefile.cfg and its variants have been moved out of their various subdirectories to src/Makefile.d make distclean removes the bin and make directories entirely, but make clean and cleandep still only affect the current build target. When I say automation, I mean that a lot of copy pasting in the Makefile has been reduced.
2021-05-02 09:54:51 +00:00
# this is needed so the target can be referenced in the
# prerequisites
.SECONDEXPANSION :
# 'UPX' is also recognized in the enviornment by upx
unexport UPX
Rewrite Makefile to be modular as well as more automated Some key points for programmers: - Source code files are mostly listed in a 'Sourcefile'. So you no longer directly edit the object list. There can be multiple Sourcefiles and they can even live in subdirectories--the directory name will be prepended to every filename in the list. Of course, the Makefile still needs to be edited to read from each Sourcefile. - Different rules are no longer required for source code files that live in subdirectories (such as sdl/ or hardware/). Subdirectories Just Work so go ham! In addition to those points, another important change is that the bin directory is no longer divided into platform subdirectories (Linux64, Mingw, etc). Executables now go directly into bin. If you use DEBUGMODE or target 64-bit, then subdirectories for 'debug' and '64' will be made though. Oh by the way, I don't think make clean actually removed files before on Windows. It should now. I also fixed as many little inconsistencies like that as I noticed. And now just an overview of the technical aspects that shouldn't affect anyone who doesn't REALLY care about the Makefile... objs and dep directories have been moved to a make directory. Makefile.cfg and its variants have been moved out of their various subdirectories to src/Makefile.d make distclean removes the bin and make directories entirely, but make clean and cleandep still only affect the current build target. When I say automation, I mean that a lot of copy pasting in the Makefile has been reduced.
2021-05-02 09:54:51 +00:00
# executable stripped of debugging symbols
$(exe) : $(dbg) | $$(@D)/
$(.)$(OBJCOPY) --strip-debug $< $@
$(.)-$(OBJCOPY) --add-gnu-debuglink=$< $@
ifdef UPX
Rewrite Makefile to be modular as well as more automated Some key points for programmers: - Source code files are mostly listed in a 'Sourcefile'. So you no longer directly edit the object list. There can be multiple Sourcefiles and they can even live in subdirectories--the directory name will be prepended to every filename in the list. Of course, the Makefile still needs to be edited to read from each Sourcefile. - Different rules are no longer required for source code files that live in subdirectories (such as sdl/ or hardware/). Subdirectories Just Work so go ham! In addition to those points, another important change is that the bin directory is no longer divided into platform subdirectories (Linux64, Mingw, etc). Executables now go directly into bin. If you use DEBUGMODE or target 64-bit, then subdirectories for 'debug' and '64' will be made though. Oh by the way, I don't think make clean actually removed files before on Windows. It should now. I also fixed as many little inconsistencies like that as I noticed. And now just an overview of the technical aspects that shouldn't affect anyone who doesn't REALLY care about the Makefile... objs and dep directories have been moved to a make directory. Makefile.cfg and its variants have been moved out of their various subdirectories to src/Makefile.d make distclean removes the bin and make directories entirely, but make clean and cleandep still only affect the current build target. When I say automation, I mean that a lot of copy pasting in the Makefile has been reduced.
2021-05-02 09:54:51 +00:00
$(call Echo,Compressing final executable...)
$(.)-$(UPX) $@
2014-03-15 16:59:03 +00:00
endif
Rewrite Makefile to be modular as well as more automated Some key points for programmers: - Source code files are mostly listed in a 'Sourcefile'. So you no longer directly edit the object list. There can be multiple Sourcefiles and they can even live in subdirectories--the directory name will be prepended to every filename in the list. Of course, the Makefile still needs to be edited to read from each Sourcefile. - Different rules are no longer required for source code files that live in subdirectories (such as sdl/ or hardware/). Subdirectories Just Work so go ham! In addition to those points, another important change is that the bin directory is no longer divided into platform subdirectories (Linux64, Mingw, etc). Executables now go directly into bin. If you use DEBUGMODE or target 64-bit, then subdirectories for 'debug' and '64' will be made though. Oh by the way, I don't think make clean actually removed files before on Windows. It should now. I also fixed as many little inconsistencies like that as I noticed. And now just an overview of the technical aspects that shouldn't affect anyone who doesn't REALLY care about the Makefile... objs and dep directories have been moved to a make directory. Makefile.cfg and its variants have been moved out of their various subdirectories to src/Makefile.d make distclean removes the bin and make directories entirely, but make clean and cleandep still only affect the current build target. When I say automation, I mean that a lot of copy pasting in the Makefile has been reduced.
2021-05-02 09:54:51 +00:00
# original executable with debugging symbols
$(dbg) : $(objects) | $$(@D)/
$(call Echo,Linking $(@F)...)
$(.)$(LD) -o $@ $^ $(LDFLAGS)
2014-03-15 16:59:03 +00:00
Rewrite Makefile to be modular as well as more automated Some key points for programmers: - Source code files are mostly listed in a 'Sourcefile'. So you no longer directly edit the object list. There can be multiple Sourcefiles and they can even live in subdirectories--the directory name will be prepended to every filename in the list. Of course, the Makefile still needs to be edited to read from each Sourcefile. - Different rules are no longer required for source code files that live in subdirectories (such as sdl/ or hardware/). Subdirectories Just Work so go ham! In addition to those points, another important change is that the bin directory is no longer divided into platform subdirectories (Linux64, Mingw, etc). Executables now go directly into bin. If you use DEBUGMODE or target 64-bit, then subdirectories for 'debug' and '64' will be made though. Oh by the way, I don't think make clean actually removed files before on Windows. It should now. I also fixed as many little inconsistencies like that as I noticed. And now just an overview of the technical aspects that shouldn't affect anyone who doesn't REALLY care about the Makefile... objs and dep directories have been moved to a make directory. Makefile.cfg and its variants have been moved out of their various subdirectories to src/Makefile.d make distclean removes the bin and make directories entirely, but make clean and cleandep still only affect the current build target. When I say automation, I mean that a lot of copy pasting in the Makefile has been reduced.
2021-05-02 09:54:51 +00:00
# disassembly of executable
$(dbg).txt : $(dbg)
$(call Echo,Dumping debugging info...)
$(.)$(OBJDUMP) $< > $@
$(.)$(GZIP) $@
2014-03-15 16:59:03 +00:00
Rewrite Makefile to be modular as well as more automated Some key points for programmers: - Source code files are mostly listed in a 'Sourcefile'. So you no longer directly edit the object list. There can be multiple Sourcefiles and they can even live in subdirectories--the directory name will be prepended to every filename in the list. Of course, the Makefile still needs to be edited to read from each Sourcefile. - Different rules are no longer required for source code files that live in subdirectories (such as sdl/ or hardware/). Subdirectories Just Work so go ham! In addition to those points, another important change is that the bin directory is no longer divided into platform subdirectories (Linux64, Mingw, etc). Executables now go directly into bin. If you use DEBUGMODE or target 64-bit, then subdirectories for 'debug' and '64' will be made though. Oh by the way, I don't think make clean actually removed files before on Windows. It should now. I also fixed as many little inconsistencies like that as I noticed. And now just an overview of the technical aspects that shouldn't affect anyone who doesn't REALLY care about the Makefile... objs and dep directories have been moved to a make directory. Makefile.cfg and its variants have been moved out of their various subdirectories to src/Makefile.d make distclean removes the bin and make directories entirely, but make clean and cleandep still only affect the current build target. When I say automation, I mean that a lot of copy pasting in the Makefile has been reduced.
2021-05-02 09:54:51 +00:00
# '::' means run unconditionally
# this really updates comptime.h
comptime.c ::
ifdef WINDOWSHELL
$(.)..\comptime.bat .
else
$(.)../comptime.sh .
2014-03-15 16:59:03 +00:00
endif
Rewrite Makefile to be modular as well as more automated Some key points for programmers: - Source code files are mostly listed in a 'Sourcefile'. So you no longer directly edit the object list. There can be multiple Sourcefiles and they can even live in subdirectories--the directory name will be prepended to every filename in the list. Of course, the Makefile still needs to be edited to read from each Sourcefile. - Different rules are no longer required for source code files that live in subdirectories (such as sdl/ or hardware/). Subdirectories Just Work so go ham! In addition to those points, another important change is that the bin directory is no longer divided into platform subdirectories (Linux64, Mingw, etc). Executables now go directly into bin. If you use DEBUGMODE or target 64-bit, then subdirectories for 'debug' and '64' will be made though. Oh by the way, I don't think make clean actually removed files before on Windows. It should now. I also fixed as many little inconsistencies like that as I noticed. And now just an overview of the technical aspects that shouldn't affect anyone who doesn't REALLY care about the Makefile... objs and dep directories have been moved to a make directory. Makefile.cfg and its variants have been moved out of their various subdirectories to src/Makefile.d make distclean removes the bin and make directories entirely, but make clean and cleandep still only affect the current build target. When I say automation, I mean that a lot of copy pasting in the Makefile has been reduced.
2021-05-02 09:54:51 +00:00
# I wish I could make dependencies out of rc files :(
$(objdir)/win32/Srb2win.res : \
win32/afxres.h win32/resource.h
Rewrite Makefile to be modular as well as more automated Some key points for programmers: - Source code files are mostly listed in a 'Sourcefile'. So you no longer directly edit the object list. There can be multiple Sourcefiles and they can even live in subdirectories--the directory name will be prepended to every filename in the list. Of course, the Makefile still needs to be edited to read from each Sourcefile. - Different rules are no longer required for source code files that live in subdirectories (such as sdl/ or hardware/). Subdirectories Just Work so go ham! In addition to those points, another important change is that the bin directory is no longer divided into platform subdirectories (Linux64, Mingw, etc). Executables now go directly into bin. If you use DEBUGMODE or target 64-bit, then subdirectories for 'debug' and '64' will be made though. Oh by the way, I don't think make clean actually removed files before on Windows. It should now. I also fixed as many little inconsistencies like that as I noticed. And now just an overview of the technical aspects that shouldn't affect anyone who doesn't REALLY care about the Makefile... objs and dep directories have been moved to a make directory. Makefile.cfg and its variants have been moved out of their various subdirectories to src/Makefile.d make distclean removes the bin and make directories entirely, but make clean and cleandep still only affect the current build target. When I say automation, I mean that a lot of copy pasting in the Makefile has been reduced.
2021-05-02 09:54:51 +00:00
# dependency recipe template
# 1: source file suffix
# 2: extra flags to gcc
define _recipe =
$(depdir)/%.d : %.$(1) | $$$$(@D)/
ifndef WINDOWSHELL
Rewrite Makefile to be modular as well as more automated Some key points for programmers: - Source code files are mostly listed in a 'Sourcefile'. So you no longer directly edit the object list. There can be multiple Sourcefiles and they can even live in subdirectories--the directory name will be prepended to every filename in the list. Of course, the Makefile still needs to be edited to read from each Sourcefile. - Different rules are no longer required for source code files that live in subdirectories (such as sdl/ or hardware/). Subdirectories Just Work so go ham! In addition to those points, another important change is that the bin directory is no longer divided into platform subdirectories (Linux64, Mingw, etc). Executables now go directly into bin. If you use DEBUGMODE or target 64-bit, then subdirectories for 'debug' and '64' will be made though. Oh by the way, I don't think make clean actually removed files before on Windows. It should now. I also fixed as many little inconsistencies like that as I noticed. And now just an overview of the technical aspects that shouldn't affect anyone who doesn't REALLY care about the Makefile... objs and dep directories have been moved to a make directory. Makefile.cfg and its variants have been moved out of their various subdirectories to src/Makefile.d make distclean removes the bin and make directories entirely, but make clean and cleandep still only affect the current build target. When I say automation, I mean that a lot of copy pasting in the Makefile has been reduced.
2021-05-02 09:54:51 +00:00
ifdef Echo_name
@printf '%-20.20s\r' $$<
endif
2014-03-15 16:59:03 +00:00
endif
Rewrite Makefile to be modular as well as more automated Some key points for programmers: - Source code files are mostly listed in a 'Sourcefile'. So you no longer directly edit the object list. There can be multiple Sourcefiles and they can even live in subdirectories--the directory name will be prepended to every filename in the list. Of course, the Makefile still needs to be edited to read from each Sourcefile. - Different rules are no longer required for source code files that live in subdirectories (such as sdl/ or hardware/). Subdirectories Just Work so go ham! In addition to those points, another important change is that the bin directory is no longer divided into platform subdirectories (Linux64, Mingw, etc). Executables now go directly into bin. If you use DEBUGMODE or target 64-bit, then subdirectories for 'debug' and '64' will be made though. Oh by the way, I don't think make clean actually removed files before on Windows. It should now. I also fixed as many little inconsistencies like that as I noticed. And now just an overview of the technical aspects that shouldn't affect anyone who doesn't REALLY care about the Makefile... objs and dep directories have been moved to a make directory. Makefile.cfg and its variants have been moved out of their various subdirectories to src/Makefile.d make distclean removes the bin and make directories entirely, but make clean and cleandep still only affect the current build target. When I say automation, I mean that a lot of copy pasting in the Makefile has been reduced.
2021-05-02 09:54:51 +00:00
$(.)$(CC) -MM -MF $$@ -MT $(objdir)/$$(*F).o $(2) $$<
endef
Rewrite Makefile to be modular as well as more automated Some key points for programmers: - Source code files are mostly listed in a 'Sourcefile'. So you no longer directly edit the object list. There can be multiple Sourcefiles and they can even live in subdirectories--the directory name will be prepended to every filename in the list. Of course, the Makefile still needs to be edited to read from each Sourcefile. - Different rules are no longer required for source code files that live in subdirectories (such as sdl/ or hardware/). Subdirectories Just Work so go ham! In addition to those points, another important change is that the bin directory is no longer divided into platform subdirectories (Linux64, Mingw, etc). Executables now go directly into bin. If you use DEBUGMODE or target 64-bit, then subdirectories for 'debug' and '64' will be made though. Oh by the way, I don't think make clean actually removed files before on Windows. It should now. I also fixed as many little inconsistencies like that as I noticed. And now just an overview of the technical aspects that shouldn't affect anyone who doesn't REALLY care about the Makefile... objs and dep directories have been moved to a make directory. Makefile.cfg and its variants have been moved out of their various subdirectories to src/Makefile.d make distclean removes the bin and make directories entirely, but make clean and cleandep still only affect the current build target. When I say automation, I mean that a lot of copy pasting in the Makefile has been reduced.
2021-05-02 09:54:51 +00:00
$(eval $(call _recipe,c))
$(eval $(call _recipe,s,$(ASFLAGS)))
# compiling recipe template
# 1: target file suffix
# 2: source file suffix
# 3: compile command
define _recipe =
$(objdir)/%.$(1) : %.$(2) | $$$$(@D)/
$(call Echo_name,$$<)
$(.)$(3)
endef
2014-03-15 16:59:03 +00:00
Rewrite Makefile to be modular as well as more automated Some key points for programmers: - Source code files are mostly listed in a 'Sourcefile'. So you no longer directly edit the object list. There can be multiple Sourcefiles and they can even live in subdirectories--the directory name will be prepended to every filename in the list. Of course, the Makefile still needs to be edited to read from each Sourcefile. - Different rules are no longer required for source code files that live in subdirectories (such as sdl/ or hardware/). Subdirectories Just Work so go ham! In addition to those points, another important change is that the bin directory is no longer divided into platform subdirectories (Linux64, Mingw, etc). Executables now go directly into bin. If you use DEBUGMODE or target 64-bit, then subdirectories for 'debug' and '64' will be made though. Oh by the way, I don't think make clean actually removed files before on Windows. It should now. I also fixed as many little inconsistencies like that as I noticed. And now just an overview of the technical aspects that shouldn't affect anyone who doesn't REALLY care about the Makefile... objs and dep directories have been moved to a make directory. Makefile.cfg and its variants have been moved out of their various subdirectories to src/Makefile.d make distclean removes the bin and make directories entirely, but make clean and cleandep still only affect the current build target. When I say automation, I mean that a lot of copy pasting in the Makefile has been reduced.
2021-05-02 09:54:51 +00:00
$(eval $(call _recipe,o,c,$(CC) -c -o $$@ $$<))
$(eval $(call _recipe,o,nas,$(NASM) -o $$@ $$<))
$(eval $(call _recipe,o,s,$(CC) $(ASFLAGS) -c -o $$@ $$<))
$(eval $(call _recipe,res,rc,$(WINDRES) -i $$< -o $$@))
2014-03-15 16:59:03 +00:00
_rm=$(.)$(rmrf) $(call Windows_path,$(1))
Rewrite Makefile to be modular as well as more automated Some key points for programmers: - Source code files are mostly listed in a 'Sourcefile'. So you no longer directly edit the object list. There can be multiple Sourcefiles and they can even live in subdirectories--the directory name will be prepended to every filename in the list. Of course, the Makefile still needs to be edited to read from each Sourcefile. - Different rules are no longer required for source code files that live in subdirectories (such as sdl/ or hardware/). Subdirectories Just Work so go ham! In addition to those points, another important change is that the bin directory is no longer divided into platform subdirectories (Linux64, Mingw, etc). Executables now go directly into bin. If you use DEBUGMODE or target 64-bit, then subdirectories for 'debug' and '64' will be made though. Oh by the way, I don't think make clean actually removed files before on Windows. It should now. I also fixed as many little inconsistencies like that as I noticed. And now just an overview of the technical aspects that shouldn't affect anyone who doesn't REALLY care about the Makefile... objs and dep directories have been moved to a make directory. Makefile.cfg and its variants have been moved out of their various subdirectories to src/Makefile.d make distclean removes the bin and make directories entirely, but make clean and cleandep still only affect the current build target. When I say automation, I mean that a lot of copy pasting in the Makefile has been reduced.
2021-05-02 09:54:51 +00:00
cleandep :
$(call _rm,$(depends) comptime.h)
2014-03-15 16:59:03 +00:00
Rewrite Makefile to be modular as well as more automated Some key points for programmers: - Source code files are mostly listed in a 'Sourcefile'. So you no longer directly edit the object list. There can be multiple Sourcefiles and they can even live in subdirectories--the directory name will be prepended to every filename in the list. Of course, the Makefile still needs to be edited to read from each Sourcefile. - Different rules are no longer required for source code files that live in subdirectories (such as sdl/ or hardware/). Subdirectories Just Work so go ham! In addition to those points, another important change is that the bin directory is no longer divided into platform subdirectories (Linux64, Mingw, etc). Executables now go directly into bin. If you use DEBUGMODE or target 64-bit, then subdirectories for 'debug' and '64' will be made though. Oh by the way, I don't think make clean actually removed files before on Windows. It should now. I also fixed as many little inconsistencies like that as I noticed. And now just an overview of the technical aspects that shouldn't affect anyone who doesn't REALLY care about the Makefile... objs and dep directories have been moved to a make directory. Makefile.cfg and its variants have been moved out of their various subdirectories to src/Makefile.d make distclean removes the bin and make directories entirely, but make clean and cleandep still only affect the current build target. When I say automation, I mean that a lot of copy pasting in the Makefile has been reduced.
2021-05-02 09:54:51 +00:00
clean :
$(call _rm,$(exe) $(dbg) $(dbg).txt $(objects))
2014-03-15 16:59:03 +00:00
Rewrite Makefile to be modular as well as more automated Some key points for programmers: - Source code files are mostly listed in a 'Sourcefile'. So you no longer directly edit the object list. There can be multiple Sourcefiles and they can even live in subdirectories--the directory name will be prepended to every filename in the list. Of course, the Makefile still needs to be edited to read from each Sourcefile. - Different rules are no longer required for source code files that live in subdirectories (such as sdl/ or hardware/). Subdirectories Just Work so go ham! In addition to those points, another important change is that the bin directory is no longer divided into platform subdirectories (Linux64, Mingw, etc). Executables now go directly into bin. If you use DEBUGMODE or target 64-bit, then subdirectories for 'debug' and '64' will be made though. Oh by the way, I don't think make clean actually removed files before on Windows. It should now. I also fixed as many little inconsistencies like that as I noticed. And now just an overview of the technical aspects that shouldn't affect anyone who doesn't REALLY care about the Makefile... objs and dep directories have been moved to a make directory. Makefile.cfg and its variants have been moved out of their various subdirectories to src/Makefile.d make distclean removes the bin and make directories entirely, but make clean and cleandep still only affect the current build target. When I say automation, I mean that a lot of copy pasting in the Makefile has been reduced.
2021-05-02 09:54:51 +00:00
distclean :
$(call _rm,../bin ../objs ../deps comptime.h)
2014-03-15 16:59:03 +00:00
Rewrite Makefile to be modular as well as more automated Some key points for programmers: - Source code files are mostly listed in a 'Sourcefile'. So you no longer directly edit the object list. There can be multiple Sourcefiles and they can even live in subdirectories--the directory name will be prepended to every filename in the list. Of course, the Makefile still needs to be edited to read from each Sourcefile. - Different rules are no longer required for source code files that live in subdirectories (such as sdl/ or hardware/). Subdirectories Just Work so go ham! In addition to those points, another important change is that the bin directory is no longer divided into platform subdirectories (Linux64, Mingw, etc). Executables now go directly into bin. If you use DEBUGMODE or target 64-bit, then subdirectories for 'debug' and '64' will be made though. Oh by the way, I don't think make clean actually removed files before on Windows. It should now. I also fixed as many little inconsistencies like that as I noticed. And now just an overview of the technical aspects that shouldn't affect anyone who doesn't REALLY care about the Makefile... objs and dep directories have been moved to a make directory. Makefile.cfg and its variants have been moved out of their various subdirectories to src/Makefile.d make distclean removes the bin and make directories entirely, but make clean and cleandep still only affect the current build target. When I say automation, I mean that a lot of copy pasting in the Makefile has been reduced.
2021-05-02 09:54:51 +00:00
info:
ifdef WINDOWSHELL
@REM
2014-03-15 16:59:03 +00:00
else
Rewrite Makefile to be modular as well as more automated Some key points for programmers: - Source code files are mostly listed in a 'Sourcefile'. So you no longer directly edit the object list. There can be multiple Sourcefiles and they can even live in subdirectories--the directory name will be prepended to every filename in the list. Of course, the Makefile still needs to be edited to read from each Sourcefile. - Different rules are no longer required for source code files that live in subdirectories (such as sdl/ or hardware/). Subdirectories Just Work so go ham! In addition to those points, another important change is that the bin directory is no longer divided into platform subdirectories (Linux64, Mingw, etc). Executables now go directly into bin. If you use DEBUGMODE or target 64-bit, then subdirectories for 'debug' and '64' will be made though. Oh by the way, I don't think make clean actually removed files before on Windows. It should now. I also fixed as many little inconsistencies like that as I noticed. And now just an overview of the technical aspects that shouldn't affect anyone who doesn't REALLY care about the Makefile... objs and dep directories have been moved to a make directory. Makefile.cfg and its variants have been moved out of their various subdirectories to src/Makefile.d make distclean removes the bin and make directories entirely, but make clean and cleandep still only affect the current build target. When I say automation, I mean that a lot of copy pasting in the Makefile has been reduced.
2021-05-02 09:54:51 +00:00
@:
2014-03-15 16:59:03 +00:00
endif