Mingw studio怎么配置生成汇编文件啊?
时间:2011-12-06
来源:互联网
1. 怎么配置Mingw studio能生成汇编文件啊?
2. 或者怎么修改下面的makefile,用MingW-make.exe生成汇编文件啊?
#################################################################
## This Makefile Exported by MinGW Developer Studio
## Copyright (c) 2002-2004 by Parinya Thipchart
#################################################################
ifneq (,$(findstring Release, $(CFG)))
override CFG = Release
else
override CFG = Debug
endif
PROJECT = 1
CC = "C:\MinGWStudio\MinGW\bin\gcc.exe"
ifeq ($(CFG),Debug)
OBJ_DIR = Debug
OUTPUT_DIR = Debug
TARGET = 1.exe
C_INCLUDE_DIRS =
C_PREPROC =
CFLAGS = -pipe -Wall -g2 -O0
RC_INCLUDE_DIRS =
RC_PREPROC =
RCFLAGS =
LIB_DIRS =
LIBS =
LDFLAGS = -pipe
endif
ifeq ($(CFG),Release)
OBJ_DIR = Release
OUTPUT_DIR = Release
TARGET = 1.exe
C_INCLUDE_DIRS =
C_PREPROC =
CFLAGS = -pipe -Wall -g0 -O2
RC_INCLUDE_DIRS =
RC_PREPROC =
RCFLAGS =
LIB_DIRS =
LIBS =
LDFLAGS = -pipe -s
endif
ifeq ($(OS),Windows_NT)
NULL =
else
NULL = nul
endif
SRC_OBJS = \
$(OBJ_DIR)/main.o
define build_target
@echo Linking...
@$(CC) -o "$(OUTPUT_DIR)\$(TARGET)" $(SRC_OBJS) $(LIB_DIRS) $(LIBS) $(LDFLAGS)
endef
define compile_source
@echo Compiling $<
@$(CC) $(CFLAGS) $(C_PREPROC) $(C_INCLUDE_DIRS) -c "$<" -o "$@"
endef
.PHONY: print_header directories
$(TARGET): print_header directories $(SRC_OBJS)
$(build_target)
.PHONY: clean cleanall
cleanall:
@echo Deleting intermediate files for '1 - $(CFG)'
-@del $(OBJ_DIR)\*.o
-@del "$(OUTPUT_DIR)\$(TARGET)"
-@rmdir "$(OUTPUT_DIR)"
clean:
@echo Deleting intermediate files for '1 - $(CFG)'
-@del $(OBJ_DIR)\*.o
print_header:
@echo ----------Configuration: 1 - $(CFG)----------
directories:
-@if not exist "$(OUTPUT_DIR)\$(NULL)" mkdir "$(OUTPUT_DIR)"
-@if not exist "$(OBJ_DIR)\$(NULL)" mkdir "$(OBJ_DIR)"
$(OBJ_DIR)/main.o: main.c
$(compile_source)
2. 或者怎么修改下面的makefile,用MingW-make.exe生成汇编文件啊?
#################################################################
## This Makefile Exported by MinGW Developer Studio
## Copyright (c) 2002-2004 by Parinya Thipchart
#################################################################
ifneq (,$(findstring Release, $(CFG)))
override CFG = Release
else
override CFG = Debug
endif
PROJECT = 1
CC = "C:\MinGWStudio\MinGW\bin\gcc.exe"
ifeq ($(CFG),Debug)
OBJ_DIR = Debug
OUTPUT_DIR = Debug
TARGET = 1.exe
C_INCLUDE_DIRS =
C_PREPROC =
CFLAGS = -pipe -Wall -g2 -O0
RC_INCLUDE_DIRS =
RC_PREPROC =
RCFLAGS =
LIB_DIRS =
LIBS =
LDFLAGS = -pipe
endif
ifeq ($(CFG),Release)
OBJ_DIR = Release
OUTPUT_DIR = Release
TARGET = 1.exe
C_INCLUDE_DIRS =
C_PREPROC =
CFLAGS = -pipe -Wall -g0 -O2
RC_INCLUDE_DIRS =
RC_PREPROC =
RCFLAGS =
LIB_DIRS =
LIBS =
LDFLAGS = -pipe -s
endif
ifeq ($(OS),Windows_NT)
NULL =
else
NULL = nul
endif
SRC_OBJS = \
$(OBJ_DIR)/main.o
define build_target
@echo Linking...
@$(CC) -o "$(OUTPUT_DIR)\$(TARGET)" $(SRC_OBJS) $(LIB_DIRS) $(LIBS) $(LDFLAGS)
endef
define compile_source
@echo Compiling $<
@$(CC) $(CFLAGS) $(C_PREPROC) $(C_INCLUDE_DIRS) -c "$<" -o "$@"
endef
.PHONY: print_header directories
$(TARGET): print_header directories $(SRC_OBJS)
$(build_target)
.PHONY: clean cleanall
cleanall:
@echo Deleting intermediate files for '1 - $(CFG)'
-@del $(OBJ_DIR)\*.o
-@del "$(OUTPUT_DIR)\$(TARGET)"
-@rmdir "$(OUTPUT_DIR)"
clean:
@echo Deleting intermediate files for '1 - $(CFG)'
-@del $(OBJ_DIR)\*.o
print_header:
@echo ----------Configuration: 1 - $(CFG)----------
directories:
-@if not exist "$(OUTPUT_DIR)\$(NULL)" mkdir "$(OUTPUT_DIR)"
-@if not exist "$(OBJ_DIR)\$(NULL)" mkdir "$(OBJ_DIR)"
$(OBJ_DIR)/main.o: main.c
$(compile_source)
作者: Start13 发布时间: 2011-12-06
gcc 只要加 -S参数就可以生成与.c或.cpp同名的.s汇编程序,但它是AT&T格式的
上面的make文件
改
LDFLAGS = -pipe -s
为
LDFLAGS = -pipe -s -S
就应该可以了
上面的make文件
改
LDFLAGS = -pipe -s
为
LDFLAGS = -pipe -s -S
就应该可以了
作者: keiy 发布时间: 2011-12-06
相关阅读 更多
热门阅读
-
office 2019专业增强版最新2021版激活秘钥/序列号/激活码推荐 附激活工具
阅读:74
-
如何安装mysql8.0
阅读:31
-
Word快速设置标题样式步骤详解
阅读:28
-
20+道必知必会的Vue面试题(附答案解析)
阅读:37
-
HTML如何制作表单
阅读:22
-
百词斩可以改天数吗?当然可以,4个步骤轻松修改天数!
阅读:31
-
ET文件格式和XLS格式文件之间如何转化?
阅读:24
-
react和vue的区别及优缺点是什么
阅读:121
-
支付宝人脸识别如何关闭?
阅读:21
-
腾讯微云怎么修改照片或视频备份路径?
阅读:28