加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
makefile 1.94 KB
一键复制 编辑 原始数据 按行查看 历史
Lambda7355 提交于 2019-06-05 18:57 . ..
# This Makefile will build the MinGW Win32 application.
TOP_DIR = $(shell pwd)
OBJ_DIR = ${TOP_DIR}/obj
SUB_DIR = core
# Object files to create for the executable
OBJS = obj/AboutDialog.o obj/MainWindow.o obj/Resource.o obj/WinMain.o obj/Star.o obj/bitmap.o obj/cmd_target.o obj/display.o obj/rect.o obj/surface.o obj/theme.o obj/wnd.o obj/word.o obj/api_win.o obj/msg_win.o
export TOP_DIR OBJ_DIR OBJS
# Warnings to be raised by the C compiler
WARNS = -Wall
SYMBOL = -s # Remove file symbol from final binary
# Names of tools to use when building
CC = mingw32-g++.exe
RC = windres
EXE = Win32App.exe
# Compiler flags. Compile ANSI build only if CHARSET=ANSI.
ifeq (${CHARSET}, ANSI)
CFLAGS = -O2 -std=c++11 -D _WIN32_IE=0x0500 -D WINVER=0x0500 ${WARNS} -Iinclude -ggdb
else
CFLAGS = -O2 -std=c++11 -D UNICODE -D _UNICODE -D _WIN32_IE=0x0500 -D WINVER=0x0500 ${WARNS} -Iinclude -ggdb
endif
# Linker flags
LDFLAGS = -lgdi32 -luser32 -lkernel32 -lcomctl32 -Wl,--subsystem,windows #${SYMBOL}
.PHONY: all clean
# Build executable by default
all: mkdir ${SUB_DIR} bin/${EXE}
# Run exe
run:
bin/${EXE}
# Delete all build output
clean:
rm -rf bin/* obj/*
# Create build output directories if they don't exist
mkdir:
mkdir -p bin obj
${SUB_DIR}: ECHO
@make -C $@
ECHO:
@echo compile ${SUB_DIR}
# Compile object files for executable
obj/%.o: src/%.cpp | obj
${CC} ${CFLAGS} -c $< -o $@
# Build the resources
obj/Resource.o: res/Resource.rc res/Application.manifest res/Application.ico include/Resource.h | obj
${RC} -I./include -I./res -i $< -o $@
# Build the exectuable
bin/${EXE}: ${OBJS}
${CC} ${OBJS} -o $@ ${LDFLAGS}
# C header dependencies
obj/AboutDialog.o: include/AboutDialog.h include/Globals.h include/Resource.h
obj/MainWindow.o: include/AboutDialog.h include/Globals.h include/MainWindow.h include/Resource.h
obj/WinMain.o: include/Globals.h include/MainWindow.h include/Resource.h
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化