# # Makefile for installing Display override files into the system # include $(MAKEFILEPATH)/pb_makefiles/platform.make INSTALL_DIR=$(DSTROOT)$(SYSTEM_LIBRARY_DIR)/Displays/Overrides HDR_DIR1=$(DSTROOT)$(SYSTEM_LIBRARY_DIR)/Frameworks/IOKit.framework/Versions/A/PrivateHeaders/graphics HDR_DIR2=$(DSTROOT)$(SYSTEM_LIBRARY_DIR)/Frameworks/Kernel.framework/Versions/A/PrivateHeaders/IOKit/graphics OVERRIDES_DIR=Overrides OTHER_SRCS=Makefile SRCFILES = $(OVERRIDES_DIR) $(OTHER_SRCS) IODisplayProductIDs.h ALL_VENDORS = $(shell (cd $(OVERRIDES_DIR); echo Display*)) ifeq "" "$(SRCROOT)" SRCROOT= endif ifeq "" "$(OBJROOT)" OBJROOT=/tmp endif ifeq "" "$(SYMROOT)" SYMROOT=/tmp endif ifeq "" "$(DSTROOT)" DSTROOT=/ endif ifneq "" "$(wildcard /bin/mkdirs)" MKDIRS = /bin/mkdirs else MKDIRS = /bin/mkdir -p endif install: $(INSTALL_DIR) for vendor in $(ALL_VENDORS); \ do \ rm -rf $(INSTALL_DIR)/$$vendor; \ $(MKDIRS) $(INSTALL_DIR)/$$vendor; \ chmod 755 $(INSTALL_DIR)/$$vendor; \ install -c -m 444 $(OVERRIDES_DIR)/$$vendor/Display* $(INSTALL_DIR)/$$vendor; \ done; $(MKDIRS) $(INSTALL_DIR)/Contents/Resources/English.lproj; install -c -m 444 $(OVERRIDES_DIR)/Resources/English.lproj/Localizable.strings \ $(INSTALL_DIR)/Contents/Resources/English.lproj; rm -rf $(HDR_DIR1); \ $(MKDIRS) $(HDR_DIR1); \ chmod 755 $(HDR_DIR1); \ install -c -m 444 IODisplayProductIDs.h $(HDR_DIR1); \ rm -rf $(HDR_DIR2); \ $(MKDIRS) $(HDR_DIR2); \ chmod 755 $(HDR_DIR2); \ install -c -m 444 IODisplayProductIDs.h $(HDR_DIR2); \ (cd AppleOnboardDisplay; pbxbuild install "DSTROOT=$(DSTROOT)" "OBJROOT=$(OBJROOT)" "SYMROOT=$(SYMROOT)") installhdrs: all: default: install installsrc: SRCROOT $(SRCROOT) gnutar cf - $(SRCFILES) | (cd $(SRCROOT); gnutar xf -) (cd AppleOnboardDisplay; pbxbuild installsrc "SRCROOT=$(SRCROOT)/AppleOnboardDisplay") clean: -rm -rf $(INSTALL_DIR) (cd AppleOnboardDisplay; pbxbuild clean "DSTROOT=$(DSTROOT)" "OBJROOT=$(OBJROOT)" "SYMROOT=$(SYMROOT)") SRCROOT: @if [ -n "${$@}" ]; then exit 0; \ else echo Must define $@; exit 1; fi $(SRCROOT):: -rm -rf $(SRCROOT) $(MKDIRS) $(SRCROOT) chmod 755 $(SRCROOT) $(MKDIRS) $(SRCROOT)/AppleOnboardDisplay $(INSTALL_DIR) :: -rm -rf $@ $(MKDIRS) $@ chmod 755 $@ OVR_CFLAGS = -g -O2 -Wall $(FRAMEWORK_PATHS) \ -Wmost -Wno-four-char-constants -Wno-unknown-pragmas \ -fpascal-strings \ -I/System/Library/Frameworks/Carbon.framework/Headers \ -I/System/Library/Frameworks/Carbon.framework/PrivateHeaders OVR_FRAMEWORKS += -framework Carbon %: %.c cc $(CFLAGS) $(OVR_CFLAGS) -o $(DSTROOT)/$@ $*.c $(OVR_FRAMEWORKS) ovr: ovr.c