Releases: Wallby/makefile-mini
0.1.2 (patch for alpha)
Mainly fixes that make test
now works on windows again.
I hadn't tested it on windows as I stopped using chocolatey. I tried WSL with checking
$WSL_DISTRO_NAME
, but at the moment that broke too much of the existing code. I am now using a manual MinGW-w64 installation for the time being (until hopefully MinGW-w64 gets added to winget). To do this I manually added themingw64\bin\
folder to systemPath
environment variable, and also manually created a symbolic linkmake.exe
by runningNew-Item -ItemType SymbolicLink -Path .\make.exe -Target .\mingw32-make.exe
in themingw64\bin\
folder)
0.1.1 (patch for alpha)
Patch that mainly gets ChromeOS (linux) working again (permanently picking Windows and ChromeOS as only two target platforms).
On ChromeOS, running test executables will now modify LD_LIBRARY_PATH to allow using .so file(s) from the current folder and/or the .makefile-mini/
folder. This is a w.i.p. as it should ideally also work with external sharedlibraries, which it currently doesn't.
Other than that, the LICENSE has been changed from MIT no attribution to MIT. All older releases still have the MIT no attribution license. As the *-mini projects have more content now, I decided to switch over to MIT, but also because I don't know whether a person could misuse the MIT no attribution license to re-license my work, hence (I expect that) the MIT license should prevent this by making that explicitly not permitted.
0.1 (alpha)
First release of makefile-mini.
To use makefile_mini.mk
, include it in a Makefile
.
Then you can use functions from makefile_mini.mk
for creating shaders, libraries (both static (.lib
/.a
) and dynamic (.dll
/.so
)), executables, set up tests and generate a release (currently generating a release is only a .zip
file).
For example, for creating an executable application.exe
(if windows) or application
(if linux) from a file main.c
..
include makefile_mini.mk
# creates a variable of "type" (indicates by "_t" suffix)..
# .. mm_start_parameters_t
# there are no "types" in makefiles, but to use makefile_mini.mk this is..
# .. what is meant with "_t"
# v
$(call mm_start_parameters_t,a) #<
$(call mm_start,a) #< calls function mm_start with variable a
$(call mm_add_executable_parameters_t,b)
b.c:=main.c
$(call mm_add_executable,application,b) #< "application" here is used for the name of the application
$(call mm_stop_parameters_t,c)
$(call mm_stop,c)
Running make
will compile the executable.
Running make clean
will remove the folder .makefile-mini
and all generated binaries that are not in the folder .makefile-mini
(by default only intermediate binaries (such as .o
for C and C++, and .spvasm
for shaders) are in this folder, but binaries can be specifically ignored as well, which is done in the last example below).
To add a static library library
from two files library.c
and library.h
..
#... #< include makefile_mini.mk and mm_start are unchanged
$(call mm_add_library_parameters_t,b)
b.filetypes:=EMMLibraryfiletype_Static #< default .filetypes is empty, indicating a library with only .h/.hpp, no .c nor .cpp
b.h:=library.h #< setting .h here is required as for an external resource that references this library (e.g. c.libraries) folder for every .h will be included
b.c:=library.c
$(call mm_add_library,library,b)
$(call mm_add_executable_parameters_t,c)
c.libraries:=library #< "library" here is the first parameter that was passed to mm_add_library)
$(call mm_add_executable,application,c)
$(call mm_stop_parameters_t,d) #< it would work to leave "c" here, in C it would not
$(call mm_stop,d)
Running make
will now compile both the library and the executable, in the correct order.
To add a test there is mm_add_test
..
#... #< include makefile_mini.mk is unchanged
$(call mm_start_parameters_t,a)
# cannot be "test" as there could be e.g. both a library with resourcename test AND an executable with resourcename test, hence "^test$(MM_EXECUTABLE_EXTENSION)$$" here
# $$ because make will parse this once, hence $ would disappear
# an ignoredbinary is put in .makefile-mini
# v
a.ignoredbinaries:=^test$(MM_EXECUTABLE_EXTENSION)$$
$(call mm_start,a)
#... #< include makefile_mini.mk, mm_start, mm_add_library and mm_add_executable are unchanged
# adding a separate executable test.exe (if windows) or test (if linux) from test.c that tests the executable application.exe
# v
$(call mm_add_executable_parameters_t,d)
d.c:=test.c
$(call mm_add_executable,test,d)
$(call mm_add_test_parameters_t,e)
e.executables:=test
$(call mm_add_test,test,e) #< "test" here is currently unused but cannot be omitted
#... #< mm_stop but with "f" instead of "d"
An ignoredbinary won't be built if running make
. A test will be built if running make test
or make release
.