⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 makefile

📁 一个RPG术语查询器
💻
字号:
# Makefile

.PHONY: all clean error

ifndef UNIX
ifndef MINGW
ifndef DJGPP
error:
	@echo To build, please run 'make [platform]=1', where [platform] can be
	@echo DJGPP, MINGW, or UNIX.
endif
endif
endif

ifdef DJGPP
CC = gxx
else
CC = g++
endif

ifdef DEBUGMODE
CFLAGS = -DDEBUGMODE -g3 -Wall -W -Werror
ifdef UNIX
LDFLAGS = `allegro-config --libs debug`
else
LDFLAGS = -lalld
endif
else
CFLAGS = -Wall -W -O3 -fomit-frame-pointer -ffast-math
ifdef UNIX
LDFLAGS = `allegro-config --libs` -s
else
LDFLAGS = -lalleg -s
endif
endif

ifdef MINGW
LDFLAGS += -Wl,--subsystem=windows
else
ifdef NOCONSOLE
LDFLAGS += -Wl,--subsystem=windows
endif
endif

ifndef CPU_TYPE
ifdef DJGPP
CPU_TYPE = pentium
else
ifdef MINGW
CPU_TYPE = pentium
endif
endif
endif

ifdef CPU_TYPE
ifdef DEBUGMODE
CFLAGS += -mcpu=$(CPU_TYPE)
else
CFLAGS += -march=$(CPU_TYPE)
endif
endif

SRCS = $(wildcard source/*.cpp)
OBJFILES = $(SRCS:source/.cpp=.o)

ifdef UNIX
PROGNAME = grpg
else
PROGNAME = grpg.exe
endif

all: $(OBJFILES)
	$(CC) -o $(PROGNAME) $(OBJFILES) $(LDFLAGS)

%.o: %.cpp
	$(CC) $(CFLAGS) -o $@ -c $<

clean:
	rm *.o

veryclean:
	rm *.o
	rm $(PROGNAME)

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -