dependency scanning

svn path=/trunk/; revision=7464
This commit is contained in:
Martin Fuchs 2004-01-05 18:53:08 +00:00
parent 5463ff80c7
commit 2b81d7c7cc

View file

@ -4,26 +4,40 @@
# Makefile
#
# Windows is default host environment
ifeq ($(HOST),)
HOST = mingw32-windows
endif
ifeq ($(HOST),mingw32-linux)
CC = mingw32-gcc
CXX = mingw32-g++
LINK = mingw32-g++
RC = mingw32-windres
CD_PREFIX := ./
else
PREFIX = mingw32-
EXE_POSTFIX :=
EXE_PREFIX := ./
endif
ifeq ($(HOST),mingw32-windows)
CC = gcc
CXX = g++
LINK = g++
RC = windres
CD_PREFIX :=
PREFIX =
EXE_PREFIX :=
EXE_POSTFIX := .exe
endif
PATH_TO_TOP = ../../..
TOOLS_PATH = $(PATH_TO_TOP)/tools
ifndef UNICODE
UNICODE = 1
endif
TOOLS_PATH = ../../../tools
CFLAGS = -DWIN32 -D_ROS_ -D_WIN32_IE=0x0501 -D_WIN32_WINNT=0x0501 -fexceptions -Wall
RCFLAGS = -DWIN32 -D_ROS_
LFLAGS = -Wl,--subsystem,windows
@ -81,6 +95,8 @@ OBJECTS = \
LIBS = gdi32 comctl32 ole32 uuid wsock32
.PHONY: all depends implib clean install dist bootcd depends
all: buildno.h $(TARGET)
docu: doxy-footer.html
@ -111,14 +127,14 @@ clean:
$(TOOLS_PATH)/rdel $(TARGET) $(OBJECTS) $(PROGRAM)$(RES_SUFFIX)
# Use environment var ROS_INSTALL to override default install dir
ifeq ($(ROS_INSTALL),)
ifneq ($(ROS_INSTALL),)
INSTALL_DIR = $(ROS_INSTALL)
else
ifeq ($(HOST),mingw32-windows)
INSTALL_DIR = C:/reactos
else
INSTALL_DIR = $(PATH_TO_TOP)/reactos
endif
else
INSTALL_DIR = $(ROS_INSTALL)
endif
implib:
@ -127,3 +143,26 @@ install:
-$(TOOLS_PATH)/rcopy $(TARGET) $(INSTALL_DIR)/$(TARGET)
bootcd:
# dependency scanning
DEP_FILTERED := $(filter-out $(DEP_EXCLUDE_FILTER), $(OBJECTS:.o=.d))
DEP_FILES := $(join $(dir $(DEP_FILTERED)), $(addprefix ., $(notdir $(DEP_FILTERED))))
ifneq ($(MAKECMDGOALS),clean)
-include $(DEP_FILES)
endif
ifeq ($(HOST),mingw32-windows)
DEPENDS_EXE := ..\..\..\tools\depends
else
DEPENDS_EXE := $(TOOLS_PATH)/depends
endif
.%.d: %.c $(PATH_TO_TOP)/tools/depends$(EXE_POSTFIX)
$(CC) $(CFLAGS) -M $< | $(DEPENDS_EXE) $(@D) $@
.%.d: %.cpp $(PATH_TO_TOP)/tools/depends$(EXE_POSTFIX)
$(CC) $(CFLAGS) -M $< | $(DEPENDS_EXE) $(@D) $@