vulkan游戏引擎的makefile启动环境实现

1.makefile.engine.windows.mak

DIR := (subst /,\\,{CURDIR})

BUILD_DIR := bin

OBJ_DIR := obj

ASSEMBLY := engine

EXTENSION := .dll

COMPILER_FLAGS := -g -MD -Werror=vla -fdeclspec #-fPIC

INCLUDE_FLAGS := -Iengine\src -I$(VULKAN_SDK)\include

LINKER_FLAGS := -g -shared -luser32 -lvulkan-1 -L(VULKAN_SDK)\\Lib -L(OBJ_DIR)\engine

DEFINES := -D_DEBUG -DKEXPORT -D_CRT_SECURE_NO_WARNINGS

#Make does not offer((

rwildcard = (wildcard 12) (foreach d,(wildcard 1*),(call rwildcard,d/,$2))

SRC_FILES := (call rwildcard,(ASSEMBLY)/,*.c)

DIRECTORIES := \(ASSEMBLY)\\src (subst (DIR),,(shell dir $(ASSEMBLY)\src /S /AD /B | findstr /i src))

OBJ_FILES := (SRC_FILES:%=(OBJ_DIR)/%.o)

all: scaffold compile link

.PHONY: scaffold

scaffold:#create build directory

@echo Scaffold folder structure...

-@setlocal enableextensions enabledelayedexpansion && mkdir (addprefix (OBJ_DIR),$(DIRECTORIES)) 2>NUL || cd .

-@setlocal enableextensions enabledelayedexpansion && mkdir $(BUILD_DIR) 2>NUL || cd .

@echo Done.

.PHONY:link

link: scaffold $(OBJ_FILES)

@echo Linking $(ASSEMBLY)...

@clang (OBJ_FILES) -o (BUILD_DIR)/(ASSEMBLY)(EXTENSION) $(LINKER_FLAGS)

.PHONY: compile

compile:

@echo Compiling...

.PHONY: clean

clean:

if exist (BUILD_DIR)\\(ASSEMBLY)(EXTENSION) del (BUILD_DIR)\(ASSEMBLY)(EXTENSION)

rmdir /s /q (OBJ_DIR)\\(ASSEMBLY)

$(OBJ_DIR)/%.c.o: %.c

@echo $<...

@clang \< (COMPILER_FLAGS) -c -o @ (DEFINES) $(INCLUDE_FLAGS)

相关推荐
爱搞虚幻的阿恺5 天前
Niagara粒子系统-超炫酷的闪电特效(加餐 纸牌螺旋上升效果)
游戏·游戏引擎
_Li.5 天前
Simulink - 6DOF (Euler Angles)
人工智能·算法·机器学习·游戏引擎·cocos2d
weixin_424294675 天前
Unity 调用Steamworks API 的 SteamUserStats.RequestCurrentStats()报错
unity·游戏引擎·steamwork
HoFunGames5 天前
Unity小地图,Easy Minimap System MT-GPS插件
unity·游戏引擎
wy3258643645 天前
Unity 新输入系统InputSystem(基本操作)
unity·c#·游戏引擎
星和月5 天前
Untiy使用说明
c#·游戏引擎
小菱形_5 天前
【Unity】TimeLine
unity·游戏引擎
weixin_424294676 天前
Unity 使用Steamworks.NET
unity·游戏引擎
ellis19706 天前
Unity资源管理框架Addressables总结
unity·游戏引擎
郭逍遥6 天前
[Godot] 通过AABB包围盒和射线法检测碰撞
算法·游戏引擎·godot