[Android Software Development] fedevd:
[MENTION=3141383]ZduneX25[/MENTION] Giving a try to PatchROM for Nexus 4. On the PDF guide I am stuck on '3.2 makefile' step. Gotta complete 'makefile' but I don't know which values should I use, how gotta be that file, etc. so I took your 'makefile' as example:

#
# Makefile for xxx
#

# The original zip file, MUST be specified by each product
local-zip-file := stockrom.zip [COLOR="Red"][B][HERE I HAVE TO SET IT WITH THE NAME OF THE RECOVERY BUILT FROM SCRIPT, USUALLY CALLED 'STOCKROM.ZIP' SO GOTTA LEAVE IT HOW IT IS][/B][/COLOR]

# The output zip file of MIUI rom, the default is porting_miui.zip if not specified
local-out-zip-file := MIUI_xxx.zip [COLOR="Red"][B][HERE I HAVE TO SET IT WITH THE NAME OF THE FINAL ZIP BUILT WHERE 'xxx' USUALLY ARE THE DEVICE CODENAME BUT I CAN SET IT HOW I WANT IT][/B][/COLOR]

# All apps from original ZIP, but has smali files chanded
local-modified-apps := GalaxyS3Settings m7Parts VFX [COLOR="Red"][B][*1][/B][/COLOR]

local-modified-priv-apps := [COLOR="Red"][B][*2][/B][/COLOR]

local-modified-jars := #framework_ext [COLOR="Red"][B][*3][/B][/COLOR]

# All apks from MIUI
local-miui-removed-apps := MediaProvider SuperMarket VoiceAssist BaiduNetworkLocation GameCenter GameCenterSDKService [COLOR="Red"][B][*4][/B][/COLOR]

local-miui-removed-priv-apps := [COLOR="Red"][B][*5][/B][/COLOR]

local-miui-modified-apps := AntiSpam Backup Browser BugReport Calculator Calendar CalendarProvider CloudService Contacts \
ContactsProvider DeskClock DownloadProvider DownloadProviderUi Email FileExplorer MiuiCompass \
MiuiGallery MiuiHome MiuiKeyguard MiuiSystemUI MiuiVideo MiWallpaper Mms Music NetworkAssistant2 Notes PackageInstaller Phone \
PaymentService Provision QuickSearchBox Settings SoundRecorder TelephonyProvider ThemeManager Updater VpnDialogs \
Weather WeatherProvider XiaomiServiceFramework YellowPage [COLOR="Red"][B][*6][/B][/COLOR]

# All apps need to be removed from original ZIP file
local-remove-apps := Gallery2 Stk Launcher3 VideoEditor PicoTts HoloSpiralWallpaper MagicSmokeWallpapers Nfc \
PhaseBeam Galaxy4 NoiseField Exchange2 BasicDreams LatinIME [COLOR="Red"][B][*7][/B][/COLOR]

[*1:] local-modified-apps This line defines custom/external apps like another media player or calendar or what? What should I set here?

[*2:] local-modified-priv-apps What goes here?

[*3:] local-modified-jars What goes here? Any other framework different from the stock ones?

[*4:] local-miui-removed-apps Here I remove the MIUI apps that will not work on my device? In example, Nexus 4 came without FM Radio support so if MIUI have 'FM.apk' I gotta add it here to build the rom without 'FM.apk', right?

[*5:] local-miui-removed-priv-apps What goes here?

[*6:] local-miui-modified-apps Here goes the apps listed on the file miuiapps.mk (which is kitkat.mk on KitKat sources, right?). I gotta add all those apps listed and skip any of those apps if I want, like 'BaiduNetworkLocation' in example, right?

[*7:] local-remove-apps Here I set the stock apps that I wanna remove, right? Like live wallpapers or any app that I don't want in my final rom, right?

# Config density for co-developers to use the aaps with HDPI or XHDPI resource,
# Default configrations are HDPI for ics branch and XHDPI for jellybean branch
local-density := XHDPI

This is obvious, gotta set it with my device density..

# To include the local targets before and after zip the final ZIP file,
# and the local-targets should:
# (1) be defined after including porting.mk if using any global variable(see porting.mk)
# (2) the name should be leaded with local- to prevent any conflict with global targets
local-pre-zip := local-pre-zip-misc
local-after-zip:= local-put-to-phone

# The local targets after the zip file is generated, could include 'zip2sd' to
# deliver the zip file to phone, or to customize other actions

include $(PORT_BUILD)/porting.mk

What this defines do? How should I set it? Are important or can be removed from the 'makefile'? Can I use those values just how they are in my 'makefile'?

# To define any local-target
#updater := $(ZIP_DIR)/META-INF/com/google/android/updater-script
#pre_install_data_packages := $(TMP_DIR)/pre_install_apk_pkgname.txt
local-pre-zip-misc:
cp other/spn-conf.xml $(ZIP_DIR)/system/etc/spn-conf.xml
cp other/apns-conf.xml $(ZIP_DIR)/system/etc/apns-conf.xml
cp other/boot.img $(ZIP_DIR)/boot.img
cp other/system_fonts.xml $(ZIP_DIR)/system/etc/system_fonts.xml
cp -f other/libsqlite.so $(ZIP_DIR)/system/lib/libsqlite.so
#	cp other/su $(ZIP_DIR)/system/xbin/su

@echo Add missing stuff
#	cp -f other/icons $(ZIP_DIR)/system/media/theme/default/icons
#	cp -f other/extras/miui_mod_icons/*.png $(ZIP_DIR)/system/media/theme/miui_mod_icons/
#	cp -f other/extras/lock_wallpaper $(ZIP_DIR)/system/media/theme/default/lock_wallpaper
cp other/XiaomiAuthenticator.apk $(ZIP_DIR)/system/app/XiaomiAuthenticator.apk
#	cp other/lbesec $(ZIP_DIR)/system/xbin/lbesec

@echo Update build.prop
cp other/build.prop $(ZIP_DIR)/system/build.prop

@echo Update bootanimation
#	rm $(ZIP_DIR)/system/bin/bootanimation
cp -f other/bootanimation.zip $(ZIP_DIR)/system/media/bootanimation.zip

@echo Remove usless stuff
rm -rf $(ZIP_DIR)/data/miui/apps/*.apk
rm -rf $(ZIP_DIR)/system/priv-app/Dialer.apk
rm -rf $(ZIP_DIR)/system/priv-app/Keyguard.apk
rm -rf $(ZIP_DIR)/system/priv-app/SystemUI.apk
rm -rf $(ZIP_DIR)/system/priv-app/VoiceDialer.apk
rm -rf $(ZIP_DIR)/system/media/video/*.mp4
#	rm -rf $(ZIP_DIR)/system/tts/lang_pico/*.bin

This? Can be added to my 'makefile' just doing copy/paste? If not, what should I do?

This is a preview of your 'makefile' modified for my Nexus 4:

#
# Makefile for mako
#

# The original zip file, MUST be specified by each product
local-zip-file := stockrom.zip

# The output zip file of MIUI rom, the default is porting_miui.zip if not specified
local-out-zip-file := MIUI_mako.zip

# All apps from original ZIP, but has smali files chanded
local-modified-apps :=

local-modified-priv-apps :=

local-modified-jars := #framework_ext

# All apks from MIUI
local-miui-removed-apps := MediaProvider SuperMarket VoiceAssist BaiduNetworkLocation GameCenter GameCenterSDKService

local-miui-removed-priv-apps :=

local-miui-modified-apps := AntiSpam Backup Browser BugReport Calculator Calendar CalendarProvider CloudService Contacts \
ContactsProvider DeskClock DownloadProvider DownloadProviderUi Email FileExplorer MiuiCompass \
MiuiGallery MiuiHome MiuiKeyguard MiuiSystemUI MiuiVideo MiWallpaper Mms Music NetworkAssistant2 Notes PackageInstaller Phone \
PaymentService Provision QuickSearchBox Settings SoundRecorder TelephonyProvider ThemeManager Updater VpnDialogs \
Weather WeatherProvider XiaomiServiceFramework YellowPage

# All apps need to be removed from original ZIP file
local-remove-apps := Stk iWnnIME iWinnIME_Kbd_White \
PhaseBeam NoiseField Exchange2Google BasicDreams LatinIMEGoogle

# Config density for co-developers to use the aaps with HDPI or XHDPI resource,
# Default configrations are HDPI for ics branch and XHDPI for jellybean branch
local-density := XHDPI

# To include the local targets before and after zip the final ZIP file,
# and the local-targets should:
# (1) be defined after including porting.mk if using any global variable(see porting.mk)
# (2) the name should be leaded with local- to prevent any conflict with global targets
local-pre-zip := local-pre-zip-misc
local-after-zip:= local-put-to-phone

# The local targets after the zip file is generated, could include 'zip2sd' to
# deliver the zip file to phone, or to customize other actions

include $(PORT_BUILD)/porting.mk

# To define any local-target
#updater := $(ZIP_DIR)/META-INF/com/google/android/updater-script
#pre_install_data_packages := $(TMP_DIR)/pre_install_apk_pkgname.txt
local-pre-zip-misc:
cp other/spn-conf.xml $(ZIP_DIR)/system/etc/spn-conf.xml
cp other/apns-conf.xml $(ZIP_DIR)/system/etc/apns-conf.xml
cp other/boot.img $(ZIP_DIR)/boot.img
cp other/system_fonts.xml $(ZIP_DIR)/system/etc/system_fonts.xml
cp -f other/libsqlite.so $(ZIP_DIR)/system/lib/libsqlite.so
#	cp other/su $(ZIP_DIR)/system/xbin/su

@echo Add missing stuff
#	cp -f other/icons $(ZIP_DIR)/system/media/theme/default/icons
#	cp -f other/extras/miui_mod_icons/*.png $(ZIP_DIR)/system/media/theme/miui_mod_icons/
#	cp -f other/extras/lock_wallpaper $(ZIP_DIR)/system/media/theme/default/lock_wallpaper
cp other/XiaomiAuthenticator.apk $(ZIP_DIR)/system/app/XiaomiAuthenticator.apk
#	cp other/lbesec $(ZIP_DIR)/system/xbin/lbesec

@echo Update build.prop
cp other/build.prop $(ZIP_DIR)/system/build.prop

@echo Update bootanimation
#	rm $(ZIP_DIR)/system/bin/bootanimation
cp -f other/bootanimation.zip $(ZIP_DIR)/system/media/bootanimation.zip

@echo Remove usless stuff
rm -rf $(ZIP_DIR)/data/miui/apps/*.apk
rm -rf $(ZIP_DIR)/system/priv-app/Dialer.apk
rm -rf $(ZIP_DIR)/system/priv-app/Keyguard.apk
rm -rf $(ZIP_DIR)/system/priv-app/SystemUI.apk
rm -rf $(ZIP_DIR)/system/priv-app/VoiceDialer.apk
rm -rf $(ZIP_DIR)/system/media/video/*.mp4
#	rm -rf $(ZIP_DIR)/system/tts/lang_pico/*.bin

Can you explain me more how should I use this 'makefile'? Thanks =)