If you are new to compiling using makefile's and you want to compile something to support (UWP),
then this simple template will help you to understand how the progress is working
It's organized and easy to change.
- Normal template (manually add
.c
,.cpp
files) - Loop template (will auto compile every
.c
,.cpp
file)
- Visual Studio (with MSVC C++ build tools)
- MSYS2
- Windows SDK
In Makefile
you will find:
TargetArch
your target archTARGET_NAME
the name ofdll
orlib
(without extension)STATIC_LINKING
if you want the output aslib
VsInstallCommunity
VS installation dirWindowsSdkDir
SDK dirWindowsSDKVersion
Target build numberINCFLAGS
include folders-I"$(RootDir)/foldername"
or-I"fullpath"
[always use/
]LIBS
libraries to include [for linker]MSVCCompileFlags
custom defines-DVARIABLENAME
[-D
is fixed at the start, meansdefine
]
- Open
Makefile.common
SOURCES_C
for.c
filesSOURCES_CXX
for.cpp
files
Example (Normal):
SOURCES_C += \
file1.c \
file2.c \
file3.c
SOURCES_CXX += \
file1.cpp \
file2.cpp \
file3.cpp
Example (Loop):
SOURCES_C += *.c \
src/*.c \
src/*/*.c \
src/*/*/*.c
SOURCES_CXX += *.cpp \
src/*.cpp \
src/*/*.cpp \
src/*/*/*.cpp
From msys2:
cd "fullpath_to_library"
make -f Makefile
cd "fullpath_to_library"
make -f Makefile clean