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

📄 makefile.rules

📁 神龙卡开发原代码
💻 RULES
字号:
############################################################################### Microwindows rules Makefile# Copyright (c) 2000 Martin Jolicoeur, Greg Haerr## This makefile should be placed at the top of a project hierarchy## NOTE: The TOP environment variable should be set to that top directory##############################################################################ifeq ($(ARCH), DJGPP)SHELL = bashelseSHELL = /bin/bashendif# install directories for headers and librariesINSTALL_PREFIX = /usrHDRINSTALLDIR = $(INSTALL_PREFIX)/include/microwinLIBINSTALLDIR = $(INSTALL_PREFIX)/libINSTALL_DIR   = install -c -m 755 -o root -g root -dINSTALL_HDR   = install -c -m 644 -o root -g binINSTALL_LIB   = install -c -m 444 -o root -g binINCLUDEDIRS += -I. -I$(TOP)/include## General configuration setup (see config file)#DEFINES += -DMWPIXEL_FORMAT=$(SCREEN_PIXTYPE)ifeq ($(VTSWITCH), Y)DEFINES += -DVTSWITCH=1endififeq ($(X11), Y)CFLAGS += -DX11=1LDFLAGS += -L/usr/X11R6/lib -lX11endififeq ($(VGALIB), Y)LDFLAGS += -lvgaendififeq ($(ARCH),FREEBSD-X86)LDFLAGS += -lvglendififeq ($(QUASAROSD), Y)INCLUDEDIRS += -I$(INCRUA) -I$(INCRUA2)endififeq ($(HAVE_FILEIO), Y)DEFINES += -DHAVE_FILEIOifeq ($(HAVE_JPEG_SUPPORT), Y)DEFINES += -DHAVE_JPEG_SUPPORT=1INCLUDEDIRS += -I$(INCJPEG)endififeq ($(HAVE_PNG_SUPPORT), Y)DEFINES += -DHAVE_PNG_SUPPORT=1INCLUDEDIRS += -I$(INCPNG) -I$(INCLIBZ)endififeq ($(HAVE_T1LIB_SUPPORT), Y)DEFINES += -DHAVE_T1LIB_SUPPORT=1INCLUDEDIRS += -I$(INCT1LIB)endififeq ($(HAVE_FREETYPE_SUPPORT), Y)DEFINES += -DHAVE_FREETYPE_SUPPORT=1DEFINES += -DFREETYPE_FONT_DIR=\"$(FREETYPE_FONT_DIR)\"INCLUDEDIRS += -I$(INCFTLIB)endififeq ($(HAVE_HZK_SUPPORT), Y)DEFINES += -DHAVE_HZK_SUPPORT=1DEFINES += -DHZK_FONT_DIR="\"$(HZK_FONT_DIR)"\"endififeq ($(HAVE_BIG5_SUPPORT), Y)DEFINES += -DHAVE_BIG5_SUPPORT=1endififeq ($(HAVE_GB2312_SUPPORT), Y)DEFINES += -DHAVE_GB2312_SUPPORT=1endififeq ($(HAVE_KSC5601_SUPPORT), Y)DEFINES += -DHAVE_KSC5601_SUPPORT=1DEFINES += -DHANGUL_FONT_DIR="\"$(HANGUL_FONT_DIR)"\"endififeq ($(HAVE_BMP_SUPPORT), Y)DEFINES += -DHAVE_BMP_SUPPORT=1endififeq ($(HAVE_GIF_SUPPORT), Y)DEFINES += -DHAVE_GIF_SUPPORT=1endififeq ($(HAVE_PNM_SUPPORT), Y)DEFINES += -DHAVE_PNM_SUPPORT=1endififeq ($(HAVE_XPM_SUPPORT), Y)DEFINES += -DHAVE_XPM_SUPPORT=1endifendififeq ($(NOFONTSORCLIPPING), Y)CFLAGS += -DNOFONTSORCLIPPING=1endififeq ($(HAVE_SHAREDMEM_SUPPORT), Y)DEFINES += -DHAVE_SHAREDMEM_SUPPORT=1endififeq ($(SHAREDLIBS), Y)CFLAGS += -fpicendififeq ($(OPTIMIZE), Y)OPTFLAGS += -O3 -fomit-frame-pointer -ffunction-sections -fdata-sectionsendififeq ($(DEBUG), Y)OPTFLAGS += -ggdbelse#OPTFLAGS += -DNDEBUGendifCFLAGS += $(INCLUDEDIRS)HOSTCFLAGS := $(CFLAGS)CPPFLAGS += $(DEFINES)LDFLAGS += --gc-sections -Wl,-elf2flt="-s16384" -L$(TOP)/libARFLAGS = rs# Tools (may be overridden by Arch.rules)HOSTCC = gccCOMPILER = gccCXX_COMPILER = g++ACHIVER = arLINKER = ld# Include the rules for arch's# if the user has a specific arch local to their home load itifeq ($(HOME)/microwin/Arch.rules,$(wildcard $(HOME)/microwin/Arch.rules))include $(HOME)/microwin/Arch.ruleselseinclude $(TOP)/Arch.rulesendif# Tools ...CC = $(TOOLSPREFIX)$(COMPILER)CXX = $(TOOLSPREFIX)$(CXX_COMPILER)AR = $(TOOLSPREFIX)$(ACHIVER)LD = $(TOOLSPREFIX)$(LINKER)NM = $(TOOLSPREFIX)nmSTRIP = $(TOOLSPREFIX)stripOBJCOPY = $(TOOLSPREFIX)objcopyCP = cpMV = mv################## Libraries Section ##################MWINLIBS = $(TOP)/lib/libmwin.a $(TOP)/lib/libmwinlib.a\	$(TOP)/lib/libmwengine.a $(TOP)/lib/libmwdrivers.a\	$(TOP)/lib/libmwfonts.a $(TOP)/lib/libmwimages.aCCMWINLIBS = -lmwin -lmwinlib -lmwengine -lmwdrivers -lmwfonts -lmwin -lmwimagesifeq ($(NWIDGET), Y)NANOXCLIENTLIBS += $(TOP)/lib/libnwidget.a#ifeq ($(LINK_APP_INTO_SERVER), Y)#NANOXSERVERLIBS += $(TOP)/lib/libnwidget.a#endifendififeq ($(LINK_APP_INTO_SERVER), Y)NANOXCLIENTLIBS += $(TOP)/lib/libnano-X.a $(TOP)/lib/libmwengine.a\	$(TOP)/lib/libmwdrivers.a $(TOP)/lib/libmwfonts.aCCNANOXCLIENTLIBS += -lnano-X -lmwengine -lmwdrivers -lmwfontselseNANOXCLIENTLIBS += $(TOP)/lib/libnano-X.aCCNANOXCLIENTLIBS += -lnano-XendifNANOXSERVERLIBS += $(TOP)/lib/libmwengine.a $(TOP)/lib/libmwdrivers.a\	$(TOP)/lib/libmwfonts.aCCNANOXSERVERLIBS += -lmwengine -lmwdrivers -lmwfontsifeq ($(HAVE_FILEIO), Y)ifeq ($(HAVE_JPEG_SUPPORT), Y)MWINLIBS += $(LIBJPEG)CCMWINLIBS += $(LIBJPEG)NANOXLIBS += $(LIBJPEG)NANOXSERVERLIBS += $(LIBJPEG)ifeq ($(SHAREDLIBS), Y)	CCNANOXSERVERLIBS += $(LIBJPEG)endififeq ($(LINK_APP_INTO_SERVER), Y)	NANOXCLIENTLIBS += $(LIBJPEG)endifendififeq ($(HAVE_PNG_SUPPORT), Y)MWINLIBS += $(LIBPNG) $(LIBZ)CCMWINLIBS += $(LIBPNG) $(LIBZ)NANOXLIBS += $(LIBPNG) $(LIBZ)NANOXSERVERLIBS += $(LIBPNG) $(LIBZ)ifeq ($(SHAREDLIBS), Y)	CCNANOXSERVERLIBS += $(LIBPNG) $(LIBZ)endififeq ($(LINK_APP_INTO_SERVER), Y)	NANOXCLIENTLIBS += $(LIBPNG) $(LIBZ)endifendifendififeq ($(HAVE_T1LIB_SUPPORT), Y)MWINLIBS += $(LIBT1LIB)CCMWINLIBS += $(LIBT1LIB)NANOXLIBS += $(LIBT1LIB)NANOXSERVERLIBS += $(LIBT1LIB)ifeq ($(SHAREDLIBS), Y)	CCNANOXSERVERLIBS += $(LIBT1LIB)endififeq ($(LINK_APP_INTO_SERVER), Y)	NANOXCLIENTLIBS += $(LIBT1LIB)endif#LDFLAGS += -lmendififeq ($(HAVE_FREETYPE_SUPPORT), Y)MWINLIBS += $(LIBFTLIB)CCMWINLIBS += $(LIBFTLIB)NANOXLIBS += $(LIBFTLIB)NANOXSERVERLIBS += $(LIBFTLIB)ifeq ($(SHAREDLIBS), Y)	CCNANOXSERVERLIBS += $(LIBFTLIB)endififeq ($(LINK_APP_INTO_SERVER), Y)	NANOXCLIENTLIBS += $(LIBFTLIB)endif#LDFLAGS += -lmendififeq ($(ARCH), ELKS)CCMWINLIBS = $(MWINLIBS)CCNANOXLIBS = $(NANOXLIBS)endififeq ($(ARCH), DJGPP)CCMWINLIBS += -lgrx20CCNANOXLIBS = $(NANOXLIBS) NANOXCLIENTLIBS += -lgrx20endif################## End of Libraries Section ################### If you dont want to see every executed command ...ifeq ($(VERBOSE), N).SILENT:endif.PHONY: default subdirs clean cleandepend xconfig# Add any exportable variable hereexport TOP ARCH CONFIG## This is the default target# It looks for sub-directories with makefiles in it and tries to execute them#ifeq ($(SHAREDLIBS), Y)default: subdirs $(OBJS) $(CXXOBJS) $(TOP)/lib/$(LIBNAME) $(TOP)/lib/$(LIBNAMESO)elsedefault: subdirs $(OBJS) $(CXXOBJS) $(ASMOBJS) $(TOP)/lib/$(LIBNAME)endif# 'dirs' can be pre-specifiedifeq ($(dirs), )dirs =	$(shell for file in `\ls`; \	do if [ -d $$file -a $$file != "demos" ]; then \	if [ -f $$file/Makefile ]; then echo $$file; fi; fi; done)endif# 'demos' can be pre-specifiedifeq ($(demos), )demos =	$(shell for file in `\ls`; \	do if [ -d $$file -a $$file = "demos" ]; then \	if [ -f $$file/Makefile ]; then echo $$file; fi; fi; done)endif## Subdirectories target#subdirs:ifeq ($(ARCH), DJGPP)	$(shell set CURDIR=$(pwd);)	$(shell \	if [ ! -d $(TOP)/bin ]; \	then mkdir $(TOP)/bin; fi;)	$(shell \	if [ ! -d $(TOP)/lib ]; \	then mkdir $(TOP)/lib; fi;)endif	$(foreach dir, $(dirs), $(MAKE) -C $(dir);)## If a library name is specified,# a library of that name will be created with objects in that directory#ifneq ($(LIBNAME), )$(TOP)/lib/$(LIBNAME): $(OBJS) $(CXXOBJS)	@echo "Creating library $@ ..."	$(AR) $(ARFLAGS) $(TOP)/lib/$(LIBNAME) $(OBJS) $(CXXOBJS) $(ASMOBJS)endif## If a shared object library name is specified, link this object#ifeq ($(SHAREDLIBS), Y)$(TOP)/lib/$(LIBNAMESO): $(TOP)/lib/$(LIBNAME)	@echo "Creating shared library $@ ..."	$(LD) -shared -o $@ --whole-archive $^endif## Dependencies target for C files#.depend: $(OBJS:.o=.c) $(CXXOBJS:.o=.cc)	@echo "Updating dependencies in $(CURDIR) ..."	$(SHELL) -ec '$(HOSTCC) -MM $(CPPFLAGS) $(HOSTCFLAGS) $(OBJS:.o=.c) \	| sed '\''s/\($*\)\.o[ :]*/\1.o \$@ : $$(TOP)\/config /g'\'' > $@; \	[ -s $@ ] || rm -f $@'## Compilation target for C files#%.o:%.c	@echo "Compiling $< ..."	$(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $<## Compilation target for C++ files#%.o:%.cc	@echo "C++ compiling $< ..."	$(CXX) -c $(CFLAGS) $(CXXFLAGS) -o $@ $<## Compilation target for bmp file conversion#%.c:%.bmp $(TOP)/mwin/bmp/convbmp.c	echo "Generating $@ from bitmap file ..."	$(TOP)/bin/convbmp $< > $@xconfig:	./xconfigure# don't clean lib dircleanapps: cleandepend	@echo "Cleaning directory $(CURDIR) ..."	$(RM) core *~ *.bak *.o TAGS	$(RM) bin/*	$(foreach dir, $(dirs), $(MAKE) -C $(dir) cleanapps;)	$(foreach dir, $(demos), $(MAKE) -C $(dir) cleanapps;)clean: cleandepend	@echo "Cleaning directory $(CURDIR) ..."	$(RM) core *~ *.bak *.o TAGS	$(RM) $(TOP)/lib/*.a $(TOP)/lib/*.so	$(shell cd $(TOP)/bin; \		for file in `\ls`; do if [ ! -d $$file ]; \		then $(RM) $$file; fi; done; cd $(TOP))	$(foreach dir, $(dirs), $(MAKE) -C $(dir) clean;)	$(foreach dir, $(demos), $(MAKE) -C $(dir) clean;)cleandepend:	@echo "Cleaning dependencies in directory $(CURDIR) ..."	$(RM) .depend	$(foreach dir, $(dirs), $(MAKE) -C $(dir) cleandepend;)		$(foreach dir, $(demos), $(MAKE) -C $(dir) cleandepend;)	install: default	$(INSTALL_DIR) $(HDRINSTALLDIR)	echo "Copying hdrs to $(HDRINSTALLDIR)"	$(INSTALL_HDR) include/*.h $(HDRINSTALLDIR)	echo "Copying libs to $(LIBINSTALLDIR)"	$(INSTALL_DIR) $(LIBINSTALLDIR)	$(INSTALL_LIB) lib/*.a $(LIBINSTALLDIR)ifeq ($(SHAREDLIBS), Y)	$(INSTALL_LIB) lib/*.so $(LIBINSTALLDIR)endif	echo "Installation completed successfully."tags:	-rm -f TAGS	etags --language=c++ --append \		`find . \( -name '*.h' -o -name '*.cc' \) -print`	etags --language=c --append `find . -name \*.[hc] -print`	etags --language=asm --append `find . -name \*.[Ss] -print`## Included dependency files#ifneq ($(MAKECMDGOALS), clean)ifneq ($(MAKECMDGOALS), cleandepend)ifneq ($(MAKECMDGOALS), realclean)ifneq ($(MAKECMDGOALS), xconfig)ifneq ($(OBJS),)-include .dependendifendifendifendifendif

⌨️ 快捷键说明

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