LYNX

Links

Tags

Categories

Makefile笔记

make默认只执行第一条命令

CC       := gcc
CFLAGS := -lpthread -g
TARGETS := shit
INC := $(shell find -L ./ -name "*.h")

a:
gcc a.c ${INC} $(par) ${CFLAGS} -o shit # example: make a run par="-O2"

run:
./shit

clean:
rm ./shit

fuck:
@echo $(par) # example: make fuck par="fuck you"

dump:
objdump ./shit -S > fuck

gdb:
gdb ./shit -tui

cgdb:
cgdb ./shit
  • 头文件
SRCS    := $(shell find ./src/ -maxdepth 1 -name "*.cpp")
INC := -I./include
CFLAGS := -Wall -Werror

run:
g++ $(CFLAGS) $(INC) $(SRCS) -o md_parser
./md_parser

Tags

c

Categories

1 / 1