Skip to content
This repository has been archived by the owner on Jun 24, 2024. It is now read-only.

Latest commit

 

History

History
75 lines (54 loc) · 1.77 KB

README.md

File metadata and controls

75 lines (54 loc) · 1.77 KB

Makefile Template (UWP)

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)

Tools

Usage

In Makefile you will find:

  • TargetArch your target arch
  • TARGET_NAME the name of dll or lib (without extension)
  • STATIC_LINKING if you want the output as lib
  • VsInstallCommunity VS installation dir
  • WindowsSdkDir SDK dir
  • WindowsSDKVersion Target build number
  • INCFLAGS 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, means define]

Add c/c++ files

  • Open Makefile.common
  • SOURCES_C for .c files
  • SOURCES_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

Build

From msys2:

  • cd "fullpath_to_library"
  • make -f Makefile

Clean

  • cd "fullpath_to_library"
  • make -f Makefile clean