############################################################################## # Microwindows rules Makefile # Copyright (c) 2000 Martin Jolicoeur, Greg Haerr # Portions Copyright (c) 2002 by Koninklijke Philips Electronics N.V. # # This makefile should be placed at the top of a project hierarchy # # NOTE: The MW_DIR_SRC environment variable should be set to that top directory ############################################################################## ifeq ($(ARCH), DJGPP) SHELL = bash else SHELL = /bin/sh endif # install directories for headers and libraries INSTALL_PREFIX = /usr INSTALL_OWNER1 = -o root -g root INSTALL_OWNER2 = -o root -g bin HDRINSTALLDIR = $(INSTALL_PREFIX)/include/microwin LIBINSTALLDIR = $(INSTALL_PREFIX)/lib BININSTALLDIR = $(INSTALL_PREFIX)/bin INSTALL_DIR = install -c -m 755 $(INSTALL_OWNER1) -d INSTALL_HDR = install -c -m 644 $(INSTALL_OWNER2) INSTALL_LIB = install -c -m 644 $(INSTALL_OWNER2) INSTALL_BIN = install -c -m 755 $(INSTALL_OWNER2) ############################################################################## # Defines, includes, and core libraries. Controlled by the config file. ############################################################################## # Defines DEFINES += -DMWPIXEL_FORMAT=$(SCREEN_PIXTYPE) # Includes INCLUDEDIRS += -I. -I$(MW_DIR_SRC)/include # Libraries required for the 'engine' functionality. MW_CORE_LIBS := ifeq ($(VTSWITCH), Y) DEFINES += -DVTSWITCH=1 endif ifeq ($(X11), Y) DEFINES += -DX11=1 ifneq ($(ARCH),CYGWIN) # Cygwin can't use this - the -lX11 needs to be specified # *after* the object files that use it, but this inserts # it at the start. For Cygwin, we will add libX11.a to the # library list instead. LDFLAGS += -L/usr/X11R6/lib -lX11 else MW_CORE_LIBS += /usr/X11R6/lib/libX11.a endif ifeq ($(ARCH),FREEBSD-X86) INCLUDEDIRS += -I/usr/X11R6/include endif ifeq ($(ARCH),CYGWIN) INCLUDEDIRS += -I/usr/X11R6/include endif endif ifeq ($(VGALIB), Y) LDFLAGS += -lvga endif ifeq ($(ARCH),FREEBSD-X86) LDFLAGS += -lvgl endif ifeq ($(HAVE_FILEIO), Y) DEFINES += -DHAVE_FILEIO ifeq ($(HAVE_TIFF_SUPPORT), Y) DEFINES += -DHAVE_TIFF_SUPPORT=1 MW_CORE_LIBS += $(LIBTIFF) LDFLAGS += -lm ifneq ($(INCTIFF),) INCLUDEDIRS += -I$(INCTIFF) endif endif ifeq ($(HAVE_JPEG_SUPPORT), Y) DEFINES += -DHAVE_JPEG_SUPPORT=1 MW_CORE_LIBS += $(LIBJPEG) ifneq ($(INCJPEG),) INCLUDEDIRS += -I$(INCJPEG) endif endif ifeq ($(HAVE_PNG_SUPPORT), Y) DEFINES += -DHAVE_PNG_SUPPORT=1 MW_CORE_LIBS += $(LIBPNG) $(LIBZ) ifneq ($(INCPNG),) INCLUDEDIRS += -I$(INCPNG) endif ifneq ($(ARCH), ECOS) LDFLAGS += -lm endif endif ifeq ($(HAVE_FNT_SUPPORT), Y) DEFINES += -DHAVE_FNT_SUPPORT=1 DEFINES += -DFNT_FONT_DIR="\"$(FNT_FONT_DIR)"\" ifeq ($(HAVE_FNTGZ_SUPPORT), Y) DEFINES += -DHAVE_FNTGZ_SUPPORT=1 MW_CORE_LIBS += $(LIBZ) endif endif ifeq ($(HAVE_T1LIB_SUPPORT), Y) DEFINES += -DHAVE_T1LIB_SUPPORT=1 MW_CORE_LIBS += $(LIBT1LIB) ifneq ($(INCT1LIB),) INCLUDEDIRS += -I$(INCT1LIB) endif LDFLAGS += -lm endif ifeq ($(HAVE_FREETYPE_SUPPORT), Y) DEFINES += -DHAVE_FREETYPE_SUPPORT=1 DEFINES += -DFREETYPE_FONT_DIR=\"$(FREETYPE_FONT_DIR)\" MW_CORE_LIBS += $(LIBFTLIB) ifneq ($(INCFTLIB),) INCLUDEDIRS += -I$(INCFTLIB) endif LDFLAGS += -lm endif ifeq ($(HAVE_PCF_SUPPORT), Y) DEFINES += -DHAVE_PCF_SUPPORT=1 DEFINES += -DPCF_FONT_DIR="\"$(PCF_FONT_DIR)"\" ifeq ($(HAVE_PCFGZ_SUPPORT), Y) DEFINES += -DHAVE_PCFGZ_SUPPORT=1 MW_CORE_LIBS += $(LIBZ) endif endif ifeq ($(HAVE_HZK_SUPPORT), Y) DEFINES += -DHAVE_HZK_SUPPORT=1 DEFINES += -DHZK_FONT_DIR="\"$(HZK_FONT_DIR)"\" endif ifeq ($(HAVE_BIG5_SUPPORT), Y) DEFINES += -DHAVE_BIG5_SUPPORT=1 endif ifeq ($(HAVE_GB2312_SUPPORT), Y) DEFINES += -DHAVE_GB2312_SUPPORT=1 endif ifeq ($(HAVE_JISX0213_SUPPORT), Y) DEFINES += -DHAVE_JISX0213_SUPPORT=1 endif ifeq ($(HAVE_KSC5601_SUPPORT), Y) DEFINES += -DHAVE_KSC5601_SUPPORT=1 endif ifeq ($(HAVE_EUCJP_SUPPORT), Y) DEFINES += -DHAVE_EUCJP_SUPPORT=1 DEFINES += -DEUCJP_FONT_DIR=\"$(EUCJP_FONT_DIR)\" endif ifeq ($(HAVE_BMP_SUPPORT), Y) DEFINES += -DHAVE_BMP_SUPPORT=1 endif ifeq ($(HAVE_GIF_SUPPORT), Y) DEFINES += -DHAVE_GIF_SUPPORT=1 endif ifeq ($(HAVE_PNM_SUPPORT), Y) DEFINES += -DHAVE_PNM_SUPPORT=1 endif ifeq ($(HAVE_XPM_SUPPORT), Y) DEFINES += -DHAVE_XPM_SUPPORT=1 endif endif # NOTE: Don't need FILEIO support for FreeType 2, since it can load # from memory buffers. ifeq ($(HAVE_FREETYPE_2_SUPPORT), Y) ifeq ($(HAVE_FREETYPE_SUPPORT), Y) $(error Having both FreeType 1 and FreeType 2 support is not allowed.) endif DEFINES += -DHAVE_FREETYPE_2_SUPPORT=1 DEFINES += -DFREETYPE_FONT_DIR=\"$(FREETYPE_FONT_DIR)\" MW_CORE_LIBS += $(LIBFT2LIB) # GCC 3.2 complains if system directories (e.g. /usr/include) are # specified with "-I". For most INCxxx, we simply allow the # value to be set to empty to mean "no -I required". # Since FT2 requires $(INCFT2LIB)/freetype2 to always be # specified, we take a slightly different (and less reliable) # approach and simply skip the well-known system directories. ifneq ($(INCFT2LIB),/usr/include) ifneq ($(INCFT2LIB),/usr/local/include) INCLUDEDIRS += -I$(INCFT2LIB) endif endif INCLUDEDIRS += -I$(INCFT2LIB)/freetype2 endif ifeq ($(NOFONTSORCLIPPING), Y) DEFINES += -DNOFONTSORCLIPPING=1 endif ifeq ($(HAVE_SHAREDMEM_SUPPORT), Y) DEFINES += -DHAVE_SHAREDMEM_SUPPORT=1 endif ifeq ($(FRAMEBUFFER), Y) ifeq ($(HAVETEXTMODE), Y) DEFINES += -DHAVETEXTMODE=1 else DEFINES += -DHAVETEXTMODE=0 endif endif ifeq ($(THREADSAFE), Y) DEFINES += -DTHREADSAFE=1 #LDFLAGS += -lpthread endif # Driver-specific stuff ifneq ($(ARCH), ELKS) ifneq ($(ARCH), DJGPP) ifeq ($(EM8400), Y) DEFINES += -I$(EM8400_DIR)/include LDFLAGS += -L$(EM8400_DIR)/lib -lEM8400 endif ifeq ($(FRAMEBUFFER), Y) ifeq ($(FBVGA), Y) DEFINES += -DFBVGA=1 endif ifeq ($(INVERT4BPP), Y) DEFINES += -DINVERT4BPP=1 endif endif # FRAMEBUFER ifeq ($(X11), Y) ifeq ($(USE_EXPOSURE), Y) DEFINES += -DUSE_EXPOSURE endif ifdef SCREEN_HEIGHT DEFINES += -DSCREEN_HEIGHT=$(SCREEN_HEIGHT) endif ifdef SCREEN_WIDTH DEFINES += -DSCREEN_WIDTH=$(SCREEN_WIDTH) endif ifdef SCREEN_DEPTH DEFINES += -DSCREEN_DEPTH=$(SCREEN_DEPTH) endif endif # X11 stuff endif # !DJGPP endif # !ELKS ifeq ($(TPHELIO), Y) DEFINES += -DTPHELIO=1 endif ifeq ($(LIRCMOUSE), Y) DEFINES += -DMW_LIRC_MOUSE=1 endif ifeq ($(LIRCKBD2), Y) DEFINES += -DMW_FEATURE_TWO_KEYBOARDS=1 endif # Nano-X specific stuff ifeq ($(NANOX), Y) ifeq ($(LINK_APP_INTO_SERVER), Y) DEFINES += -DNONETWORK=1 endif endif # NANOX # Microwin-specific stuff ifeq ($(MICROWIN), Y) ifeq ($(ERASEMOVE), Y) DEFINES += -DERASEMOVE=1 endif ifeq ($(UPDATEREGIONS), Y) DEFINES += -DUPDATEREGIONS=1 endif endif ############################################################################## # Extra compiler flags. # # Note: Do not set defines, includes or libraries here! ############################################################################## # Some drivers use outb macro, requires -O optimization ifneq ($(ARCH), LINUX-TCC) ifneq ($(ARCH), DJGPP) ifeq ($(ARCH), ELKS) CFLAGS += -O else ifeq ($(FRAMEBUFFER), Y) ifeq ($(FBVGA), Y) CFLAGS += -O endif endif # FRAMEBUFER ifeq ($(HWVGA), Y) CFLAGS += -O endif endif # !ELKS endif # !DJGPP endif # !LINUX-TCC ifneq ($(ARCH), TRIMEDIA) ifeq ($(SHAREDLIBS), Y) CFLAGS += -fpic endif ifeq ($(OPTIMIZE), Y) OPTFLAGS += -O3 endif ifeq ($(GPROF), Y) OPTFLAGS += -pg LDFLAGS += -pg endif endif ifeq ($(DEBUG), Y) OPTFLAGS += -ggdb DEFINES += -DDEBUG=1 else #OPTFLAGS += -DNDEBUG endif MAKEDEPCFLAGS := HOSTCFLAGS := CPPFLAGS += $(DEFINES) LDFLAGS += -L$(MW_DIR_LIB) ifeq ($(ARCH), TRIMEDIA) ARFLAGS = r else ARFLAGS = rs endif ############################################################################## # Tools ############################################################################## # Default tools (may be overridden by Arch.rules) HOSTCC = gcc COMPILER = gcc CXX_COMPILER = g++ ACHIVER = ar LINKER = ld # Include the rules for arch's # if the user has a specific arch local to their home load it ifeq ($(HOME)/microwin/Arch.rules,$(wildcard $(HOME)/microwin/Arch.rules)) include $(HOME)/microwin/Arch.rules else include $(MW_DIR_SRC)/Arch.rules endif # Tools ... CC = $(TOOLSPREFIX)$(COMPILER) CXX = $(TOOLSPREFIX)$(CXX_COMPILER) AR = $(TOOLSPREFIX)$(ACHIVER) LD = $(TOOLSPREFIX)$(LINKER) NM = $(TOOLSPREFIX)nm STRIP = $(TOOLSPREFIX)strip OBJCOPY = $(TOOLSPREFIX)objcopy CP = cp MV = mv # Note: We don't put INCLUDEDIRS in HOSTCFLAGS. # When cross-compiling, we want to use the target headers for # generating dependencies (MAKEDEPCFLAGS), but the host's default # headers for compiling tools (HOSTCFLAGS). CFLAGS += $(INCLUDEDIRS) MAKEDEPCFLAGS += $(INCLUDEDIRS) ############################################################################## # Libraries. # # Note that libraries required by the engine (and only by the engine) are # already set in MW_CORE_LIBS. ############################################################################## MWINLIBS = \ $(MW_DIR_LIB)/libmwin.a \ $(MW_DIR_LIB)/libmwimages.a \ $(MW_CORE_LIBS) CCMWINLIBS = -lmwin -lmwimages -lm $(MW_CORE_LIBS) NANOXCLIENTLIBS += $(MW_DIR_LIB)/libnano-X.a CCNANOXCLIENTLIBS += -lnano-X ifeq ($(LINK_APP_INTO_SERVER), Y) NANOXCLIENTLIBS += $(MW_CORE_LIBS) CCNANOXCLIENTLIBS += $(MW_CORE_LIBS) endif NANOXSERVERLIBS += \ $(MW_DIR_LIB)/libmwengine.a \ $(MW_DIR_LIB)/libmwdrivers.a \ $(MW_DIR_LIB)/libmwfonts.a \ $(MW_CORE_LIBS) CCNANOXSERVERLIBS += -lmwengine -lmwdrivers -lmwfonts ifeq ($(SHAREDLIBS), Y) CCNANOXSERVERLIBS += $(MW_CORE_LIBS) endif ifeq ($(ARCH), ELKS) CCMWINLIBS = $(MWINLIBS) endif ifeq ($(ARCH), DJGPP) CCMWINLIBS += -lgrx20 NANOXCLIENTLIBS += -lgrx20 endif ifeq ($(ARCH), FREEBSD-X86) # For forkpty in nxterm. NANOXCLIENTLIBS += -lutil endif ############################################################################## # Build rules ############################################################################## # If you dont want to see every executed command ... ifeq ($(VERBOSE), N) .SILENT: endif .PHONY: default subdirs clean cleanapps xconfig makedestdirs # Add any exportable variable here export MW_DIR_SRC MW_DIR_BIN MW_DIR_LIB MW_DIR_OBJ ARCH CONFIG # Do not use standard rules such as .c.o .SUFFIXES: # Do not delete "intermediate" files, such as the .c # files created from bitmaps and fonts. .SECONDARY: # # This is the default target # It looks for sub-directories with makefiles in it and tries to execute them # ifeq ($(SHAREDLIBS), Y) default: $(MW_DIR_BIN) $(MW_DIR_LIB) subdirs $(MW_DIR_LIB)/$(LIBNAME) $(MW_DIR_LIB)/$(LIBNAMESO) else default: $(MW_DIR_BIN) $(MW_DIR_LIB) subdirs $(MW_DIR_LIB)/$(LIBNAME) endif # 'dirs' can be pre-specified ifeq ($(dirs), ) # Look for all subdirectories that contain a Makefile, # but ignore the demos/ directory (if present). # Save the list of directory names to $(dirs) - this # variable is empty if the directories do not exist. dirs := $(dir $(wildcard $(MW_DIR_SRC)/$(MW_DIR_RELATIVE)*/Makefile)) dirs := $(filter-out $(MW_DIR_SRC)/$(MW_DIR_RELATIVE)demos/,$(dirs)) dirs := $(filter-out $(MW_DIR_SRC)/$(MW_DIR_RELATIVE)ecos/,$(dirs)) dirs := $(filter-out $(MW_DIR_SRC)/$(MW_DIR_RELATIVE)rtems/,$(dirs)) endif # 'demos' can be pre-specified ifeq ($(demos), ) # Look for the subdirectory demos/ that contains a Makefile, # if present. # Save the directory name to $(demos) - this variable is # empty if the directory does not exist. demos := $(dir $(wildcard $(MW_DIR_SRC)/$(MW_DIR_RELATIVE)demos/Makefile)) endif # # Subdirectories target # # For each directory DIRNAME in $(dirs), we create a phony target # called "subdir-DIRNAME". To build that target, we recurse into # the directory with "$(MAKE) -C DIRNAME". # .PHONY: subdirs $(dirs:%=subdir-%) subdirs: $(dirs:%=subdir-%) @# $(dirs:%=subdir-%): makedestdirs $(MAKE) -C $(subst subdir-,,$@) makedestdirs: ifeq ($(ARCH), DJGPP) $(shell set CURDIR=$(pwd);) [ -d $(MW_DIR_BIN) ] || mkdir $(MW_DIR_BIN) [ -d $(MW_DIR_LIB) ] || mkdir $(MW_DIR_LIB) endif @# # # This rule creates the directory for the target. # define MW_RULE_MAKE_TARGET_DIR [ -d $(dir $@) ] || mkdir -p $(dir $@) endef # # If a library name is specified, # a library of that name will be created with objects in that directory # ifneq ($(LIBNAME),) $(MW_DIR_LIB)/$(LIBNAME): $(OBJS) $(CXXOBJS) @echo "Creating library $(patsubst $(MW_DIR_LIB)/%,%,$@) ..." $(AR) $(ARFLAGS) $(MW_DIR_LIB)/$(LIBNAME) $(OBJS) $(CXXOBJS) $(ASMOBJS) endif # # If a shared object library name is specified, link this object # ifeq ($(SHAREDLIBS), Y) $(MW_DIR_LIB)/$(LIBNAMESO): $(MW_DIR_LIB)/$(LIBNAME) @echo "Creating shared library $(patsubst $(MW_DIR_LIB)/%,%,$@) ..." $(LD) -shared -o $@ --whole-archive $^ endif # # Make sure that bin and lib directories exist # $(MW_DIR_BIN) $(MW_DIR_LIB): @mkdir -p $@ # # This rule generates a dependencies *.d file from a C or C++ source file. # The .d file is placed in the same directory as the .o file. # # The sed script replaces the short .o filename produced by gcc with the # full filename used by make. This is only necessary if make is using # a filename including a directory part, since some [all?] versions of # gcc will remove the directory. However, it does not hurt to always # use the sed script. # # Note that on error, this rule removes the (incomplete) .d file, and # also removes the .o file so that the rule will be run again next # time the user runs make. # define MW_RULE_DEPEND_C $(HOSTCC) -MM $(MAKEDEPCFLAGS) $(DEFINES) $< \ | sed 's/.*\.o[ :]*/$(subst /,\/,$@) : /g' \ > $(basename $@).d \ || (rm $@ $(basename $@).d ; exit 1) endef # # Compilation target for C files # $(MW_DIR_OBJ)/%.o: $(MW_DIR_SRC)/%.c $(CONFIG) @echo "Compiling $(patsubst $(MW_DIR_SRC)/%,%,$<) ..." ifneq ($(MW_DIR_OBJ),$(MW_DIR_SRC)) @$(MW_RULE_MAKE_TARGET_DIR) endif $(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $< $(MW_RULE_DEPEND_C) ifneq ($(MW_DIR_OBJ),$(MW_DIR_SRC)) # # Compilation target for generated C files # (e.g. C files generated from bitmaps, fonts, etc) # $(MW_DIR_OBJ)/%.o: $(MW_DIR_OBJ)/%.c $(CONFIG) @echo "Compiling $(patsubst $(MW_DIR_OBJ)/%,%,$<) ..." @$(MW_RULE_MAKE_TARGET_DIR) $(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $< $(MW_RULE_DEPEND_C) endif # # Compilation target for C++ files # $(MW_DIR_OBJ)/%.o: $(MW_DIR_SRC)/%.cc $(CONFIG) @echo "Compiling $(patsubst $(MW_DIR_SRC)/%,%,$<) ..." ifneq ($(MW_DIR_OBJ),$(MW_DIR_SRC)) @$(MW_RULE_MAKE_TARGET_DIR) endif $(CXX) -c $(CFLAGS) $(CXXFLAGS) -o $@ $< $(MW_RULE_DEPEND_C) ifneq ($(MW_DIR_OBJ),$(MW_DIR_SRC)) # # Compilation target for generated C++ files # $(MW_DIR_OBJ)/%.o: $(MW_DIR_OBJ)/%.cc $(CONFIG) @echo "Compiling $(patsubst $(MW_DIR_OBJ)/%,%,$<) ..." @$(MW_RULE_MAKE_TARGET_DIR) $(CXX) -c $(CFLAGS) $(CXXFLAGS) -o $@ $< $(MW_RULE_DEPEND_C) endif # # Compilation target for bmp file conversion # $(MW_DIR_OBJ)/%.c: $(MW_DIR_SRC)/%.bmp $(MW_DIR_BIN)/convbmp echo "Converting $(patsubst $(MW_DIR_SRC)/%,%,$<) ..." ifneq ($(MW_DIR_OBJ),$(MW_DIR_SRC)) @$(MW_RULE_MAKE_TARGET_DIR) endif $(MW_DIR_BIN)/convbmp -o $@ $< # # Compilation target for tool that does bmp file conversion # $(MW_DIR_BIN)/convbmp: $(MW_DIR_SRC)/mwin/bmp/convbmp.c echo "Building $(patsubst $(MW_DIR_BIN)/%,%,$@) tool ..." $(HOSTCC) $(HOSTCFLAGS) $< -o $@ # # Compilation target for bdf font file conversion # $(MW_DIR_OBJ)/%.c: $(MW_DIR_SRC)/%.bdf $(MW_DIR_BIN)/convbdf echo "Converting $(patsubst $(MW_DIR_SRC)/%,%,$<) ..." ifneq ($(MW_DIR_OBJ),$(MW_DIR_SRC)) @$(MW_RULE_MAKE_TARGET_DIR) endif $(MW_DIR_BIN)/convbdf -c -o $@ $< # # Compilation target for tool that does bdf font file conversion # $(MW_DIR_BIN)/convbdf: $(MW_DIR_SRC)/fonts/convbdf.c echo "Building $(patsubst $(MW_DIR_BIN)/%,%,$@) tool ..." $(HOSTCC) $(HOSTCFLAGS) $< -o $@ xconfig: ./xconfigure # don't clean lib dir cleanapps: ifneq ($(MW_DIR_OBJ),$(MW_DIR_SRC)) @echo "Cleaning $(MW_DIR_RELATIVE) ..." $(RM) -rf $(MW_DIR_OBJ)/$(MW_DIR_RELATIVE) # $(RM) -rf $(MW_DIR_BIN)/ # mkdir $(MW_DIR_BIN) endif @echo "Cleaning directory $(MW_DIR_RELATIVE) ..." $(RM) \ $(MW_DIR_OBJ)/$(MW_DIR_RELATIVE)core \ $(MW_DIR_OBJ)/$(MW_DIR_RELATIVE)*~ \ $(MW_DIR_OBJ)/$(MW_DIR_RELATIVE)*.bak \ $(MW_DIR_OBJ)/$(MW_DIR_RELATIVE)*.o \ $(MW_DIR_OBJ)/$(MW_DIR_RELATIVE)*.d \ $(MW_DIR_OBJ)/$(MW_DIR_RELATIVE)TAGS \ $(MW_DIR_BIN)/* $(foreach dir, $(dirs), $(MAKE) -C $(dir) cleanapps;) $(foreach dir, $(demos), $(MAKE) -C $(dir) cleanapps;) clean: ifneq ($(MW_DIR_OBJ),$(MW_DIR_SRC)) @echo "Cleaning $(MW_DIR_RELATIVE) ..." $(RM) -rf $(MW_DIR_OBJ)/$(MW_DIR_RELATIVE) # $(RM) -rf $(MW_DIR_BIN)/ $(MW_DIR_LIB)/ # mkdir $(MW_DIR_BIN) # mkdir $(MW_DIR_LIB) endif @echo "Cleaning directory $(MW_DIR_RELATIVE) ..." $(RM) \ $(MW_DIR_OBJ)/$(MW_DIR_RELATIVE)core \ $(MW_DIR_OBJ)/$(MW_DIR_RELATIVE)*~ \ $(MW_DIR_OBJ)/$(MW_DIR_RELATIVE)*.bak \ $(MW_DIR_OBJ)/$(MW_DIR_RELATIVE)*.o \ $(MW_DIR_OBJ)/$(MW_DIR_RELATIVE)*.d \ $(MW_DIR_OBJ)/$(MW_DIR_RELATIVE)TAGS \ $(MW_DIR_LIB)/*.a \ $(MW_DIR_LIB)/*.so for file in $(wildcard $(MW_DIR_BIN)/*); do \ if [ ! -d $$file ]; then \ $(RM) $$file; \ fi; \ done $(foreach dir, $(dirs), $(MAKE) -C $(dir) clean;) $(foreach dir, $(demos), $(MAKE) -C $(dir) clean;) install: default $(INSTALL_DIR) $(HDRINSTALLDIR) echo "Copying hdrs to $(HDRINSTALLDIR)" $(INSTALL_HDR) $(MW_DIR_SRC)/include/*.h $(HDRINSTALLDIR) echo "Copying libs to $(LIBINSTALLDIR)" $(INSTALL_DIR) $(LIBINSTALLDIR) $(INSTALL_LIB) $(MW_DIR_LIB)/*.a $(LIBINSTALLDIR) ifeq ($(SHAREDLIBS), Y) $(INSTALL_LIB) $(MW_DIR_LIB)/*.so $(LIBINSTALLDIR) endif ifeq ($(NANOX), Y) ifeq ($(LINK_APP_INTO_SERVER), N) echo "Copying binaries to $(BININSTALLDIR)" $(INSTALL_DIR) $(BININSTALLDIR) $(INSTALL_BIN) $(MW_DIR_BIN)/nano-X $(BININSTALLDIR) else rm -f $(BININSTALLDIR)/nano-X endif else rm -f $(BININSTALLDIR)/nano-X 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 ($(wildcard $(MW_DIR_OBJ)/$(MW_DIR_RELATIVE)*.d),) -include $(wildcard $(MW_DIR_OBJ)/$(MW_DIR_RELATIVE)*.d) endif endif endif endif endif