1# Common Makefile 2include $(MAKEFILEPATH)/CoreOS/ReleaseControl/Common.make 3 4# The following files vary by target platform. Start with the MacOSX defaults 5# and override as necessary. 6SRC_PASSWD= 7SRC_GROUP= 8SRC_TTYS=ttys 9 10ifdef RC_TARGET_CONFIG 11Product=$(RC_TARGET_CONFIG) 12else 13Product=MacOSX 14endif 15ifeq "$(Product)" "iPhone" 16SRC_PASSWD=master.passwd.iPhone 17SRC_GROUP=group.iPhone 18SRC_TTYS=ttys.embedded 19endif 20 21install:: validate-all install-files 22 23validate-all: 24 @echo "Validating files are UTF-8" 25 $(_v) for X in * ; do \ 26 [ \! -f "$$X" ] || iconv -f UTF-8 -t UTF-8 "$$X" >/dev/null ; \ 27 done 28 29install-files: 30 @echo "Installing $(Destination) for $(Product)" 31 $(_v) $(INSTALL_FILE) -m 0644 -c afpovertcp.cfg "$(Destination)/afpovertcp.cfg" 32ifeq "$(Product)" "MacOSX" 33 $(_v) $(INSTALL_FILE) -m 0644 -c asl.conf "$(Destination)/asl.conf" 34 $(_v) $(INSTALL_FILE) -m 0644 -c asl.conf "$(Destination)/asl.conf.install" 35 $(_v) cat asl.conf.install >> "$(Destination)/asl.conf.install" 36else 37 $(_v) $(INSTALL_FILE) -m 0644 -c asl.conf.ios "$(Destination)/asl.conf" 38endif 39 $(_v) $(INSTALL_FILE) -m 0644 -c /dev/null "$(Destination)/find.codes" 40 $(_v) $(INSTALL_FILE) -m 0644 -c ftpusers "$(Destination)/ftpusers" 41ifeq "$(Product)" "iPhone" 42 $(_v) $(INSTALL_FILE) -m 0644 -c fstab "$(Destination)/fstab" 43endif 44 $(_v) $(INSTALL_FILE) -m 0644 -c fstab.hd "$(Destination)/fstab.hd" 45 $(_v) $(INSTALL_FILE) -m 0644 -c gettytab "$(Destination)/gettytab" 46 $(_v) $(INSTALL_FILE) -m 0644 -c /dev/null "$(Destination)/hosts.equiv" 47 $(_v) $(INSTALL_FILE) -m 0644 -c kern_loader.conf "$(Destination)/kern_loader.conf" 48 $(_v) $(INSTALL_FILE) -m 0644 -c /dev/null "$(Destination)/rmtab" 49 $(_v) $(INSTALL_FILE) -m 0644 -c shells "$(Destination)/shells" 50 $(_v) $(INSTALL_FILE) -m 0644 -c syslog.conf "$(Destination)/syslog.conf" 51 $(_v) $(INSTALL_FILE) -m 0644 -c $(SRC_TTYS) "$(Destination)/ttys" 52 $(_v) $(INSTALL_FILE) -m 0644 -c /dev/null "$(Destination)/xtab" 53ifeq "$(Product)" "MacOSX" 54 $(_v) $(LN) -hfs ../var/run/resolv.conf "$(Destination)" 55endif 56ifneq "$(SRC_GROUP)" "" 57 $(_v) $(INSTALL_FILE) -m 0644 -c $(SRC_GROUP) "$(Destination)/group" 58endif 59 $(_v) $(INSTALL_FILE) -m 0644 -c hosts "$(Destination)/hosts" 60 $(_v) $(INSTALL_FILE) -m 0644 -c manpaths "$(Destination)/manpaths" 61ifneq "$(SRC_PASSWD)" "" 62 $(_v) $(INSTALL_FILE) -m 0600 -c $(SRC_PASSWD) "$(Destination)/master.passwd" 63 $(_v) cat $(SRC_PASSWD) | cut -d ':' -f 1-4,8-10 > "$(Destination)/passwd" 64 $(_v) chmod 0644 "$(Destination)/passwd" ; chown root:wheel "$(Destination)/passwd" 65endif 66 $(_v) $(INSTALL_FILE) -m 0644 -c networks "$(Destination)/networks" 67 $(_v) $(INSTALL_FILE) -m 0644 -c paths "$(Destination)/paths" 68ifeq "$(Product)" "iPhone" 69 $(_v) cat paths.iPhone >> "$(Destination)/paths" 70endif 71 $(_v) $(INSTALL_FILE) -m 0644 -c protocols "$(Destination)/protocols" 72 $(_v) $(INSTALL_FILE) -m 0644 -c rpc "$(Destination)/rpc" 73 $(_v) $(INSTALL_FILE) -m 0644 -c services "$(Destination)/services" 74