mirror of
https://github.com/SSCLI/sscli_20021101
synced 2026-06-08 12:28:57 +00:00
9fa3874800
Moved the original file to the archive subfolder.
99 lines
3.0 KiB
Plaintext
99 lines
3.0 KiB
Plaintext
# ==++==
|
|
#
|
|
#
|
|
# Copyright (c) 2002 Microsoft Corporation. All rights reserved.
|
|
#
|
|
# The use and distribution terms for this software are contained in the file
|
|
# named license.txt, which can be found in the root of this distribution.
|
|
# By using this software in any fashion, you are agreeing to be bound by the
|
|
# terms of this license.
|
|
#
|
|
# You must not remove this notice, or any other, from this software.
|
|
#
|
|
#
|
|
# ==--==
|
|
# ============================================================================
|
|
# File: makefile.common.in
|
|
# Common makefile for the PAL.
|
|
# ============================================================================
|
|
|
|
TOOL_SUBDIR = $(TOP_SRC_DIR)/build_tools
|
|
INCLUDE_DIRS = -I../$(TOP_SRC_DIR)/.. -I../$(TOP_SRC_DIR)/include \
|
|
-I../$(TOP_SRC_DIR)/obj$(BUILD_ALT_DIR)
|
|
MD_INCLUDE_DIRS = -I$(TOP_SRC_DIR)/.. -I$(TOP_SRC_DIR)/include \
|
|
-I$(TOP_SRC_DIR)/obj$(BUILD_ALT_DIR)
|
|
# The ':' here is required to keep autoconf from deleting VPATH.
|
|
VPATH = ..:
|
|
|
|
CC = @CC@
|
|
LDPARTIAL = @LDPARTIAL@
|
|
CFLAGS = @CFLAGS@
|
|
|
|
ALLCFLAGS = $(REQUIRED_CFLAGS) $(CFLAGS)
|
|
|
|
PALDEFS= @DEFS@
|
|
|
|
.SUFFIXES:
|
|
.SUFFIXES: .c .s .o
|
|
|
|
.PHONY: all check_env clean depend target target_clean
|
|
|
|
TARGET_OBJ = ../$(TOP_SRC_DIR)/obj$(BUILD_ALT_DIR)/$(MODULE_NAME)objs.o
|
|
OBJS = $(C_SRCS:.c=.o) $(ASM_SRCS:.s=.o)
|
|
|
|
# Targets
|
|
# =======
|
|
|
|
all: check_env makefile $(TOP_SRC_DIR)/obj$(BUILD_ALT_DIR)/config.h
|
|
mkdir -p obj$(BUILD_ALT_DIR)
|
|
cd obj$(BUILD_ALT_DIR) && $(MAKE) -f ../makefile COMMON_PREFIX=../$(TOP_SRC_DIR)/ target
|
|
|
|
clean: check_env
|
|
mkdir -p obj$(BUILD_ALT_DIR)
|
|
cd obj$(BUILD_ALT_DIR) && $(MAKE) -f ../makefile COMMON_PREFIX=../$(TOP_SRC_DIR)/ target_clean
|
|
|
|
target: check_env $(TARGET_OBJ)
|
|
|
|
check_env:
|
|
@if test ! $(BUILD_ALT_DIR) ; then \
|
|
echo "Environment not set. Run '. env.sh' before building the PAL"; \
|
|
exit 1; \
|
|
fi
|
|
|
|
$(TARGET_OBJ): $(OBJS)
|
|
#perform partial link to aggregate all object files in a single one
|
|
$(LDPARTIAL) $(OBJS) -o $@
|
|
|
|
makefile: makefile.in
|
|
@echo $? is newer than $@, please rerun $(TOP_SRC_DIR)/configure.
|
|
@exit 1
|
|
|
|
# configure won't regenerate config.h if nothing's changed, so the rm -f
|
|
# here forces it to do so.
|
|
$(TOP_SRC_DIR)/obj$(BUILD_ALT_DIR)/config.h: $(TOP_SRC_DIR)/config.h.in
|
|
@echo $? is newer than $@, please rerun $(TOP_SRC_DIR)/configure.
|
|
@rm -f $@
|
|
@exit 1
|
|
|
|
depend: makefile $(TOP_SRC_DIR)/obj$(BUILD_ALT_DIR)/config.h $(TOOL_SUBDIR)/mdtool
|
|
@echo Making dependencies for $(MODULE_NAME) module
|
|
$(TOOL_SUBDIR)/mdtool $(PALDEFS) $(ALLCFLAGS) $(MD_INCLUDE_DIRS) $(C_SRCS)
|
|
|
|
$(TOOL_SUBDIR)/mdtool:
|
|
cd $(TOOL_SUBDIR) && $(MAKE) mdtool
|
|
|
|
# Delete all of the .o files in obj$(BUILD_ALT_DIR). This ensures that we
|
|
# clean up properly even if the directory contains an object file from a
|
|
# file that has since been deleted from the PAL.
|
|
target_clean: check_env
|
|
rm -f *.o
|
|
rm -f $(TARGET_OBJ)
|
|
cd .. && rmdir obj$(BUILD_ALT_DIR)
|
|
|
|
.c.o:
|
|
$(CC) -c $(PALDEFS) $(ALLCFLAGS) $(INCLUDE_DIRS) $(LOCAL_INCLUDE_DIRS) -o $@ $<
|
|
|
|
.s.o:
|
|
$(CC) -x assembler-with-cpp -c $(PALDEFS) $(ALLCFLAGS) $(INCLUDE_DIRS) \
|
|
$(LOCAL_INCLUDE_DIRS) -o $@ $<
|