set ESP32_PATH=C:\Users\takada\AppData\Local\Arduino15\packages\esp32
set ESP32SDK_PATH=%ESP32_PATH%\hardware\esp32\1.0.6/tools/sdk

"%ESP32_PATH%\tools\xtensa-esp32-elf-gcc\1.22.0-97-gc752ad5-5.2.0/bin/xtensa-esp32-elf-gcc" ^
 -nostdlib ^
 "-L%ESP32SDK_PATH%/lib" ^
 "-L%ESP32SDK_PATH%/ld" ^
 -T esp32_out.ld ^
 -T esp32.project.ld ^
 -T esp32.rom.ld ^
 -T esp32.peripherals.ld ^
 -T esp32.rom.libgcc.ld ^
 -T esp32.rom.spiram_incompatible_fns.ld ^
 -u esp_app_desc ^
 -u ld_include_panic_highint_hdl ^
 -u call_user_start_cpu0 ^
 -Wl,--gc-sections ^
 -Wl,-static ^
 -Wl,--undefined=uxTopUsedPriority ^
 -u __cxa_guard_dummy ^
 -u __cxx_fatal_exception ^
 -Wl,--start-group ^
 "esp-ir.ino.cpp.o" ^
 "espIrConfig.cpp.o" ^
 "irLedCtrl.cpp.o" ^
 "webConfig.cpp.o" ^
 "ETH.cpp.o" ^
 "WiFi.cpp.o" ^
 "WiFiAP.cpp.o" ^
 "WiFiClient.cpp.o" ^
 "WiFiGeneric.cpp.o" ^
 "WiFiMulti.cpp.o" ^
 "WiFiSTA.cpp.o" ^
 "WiFiScan.cpp.o" ^
 "WiFiServer.cpp.o" ^
 "WiFiUdp.cpp.o" ^
 "ESPmDNS.cpp.o" ^
 "SPIFFS.cpp.o" ^
 "FS.cpp.o" ^
 "vfs_api.cpp.o" ^
 "PubSubClient.cpp.o" ^
 "WiFiClientSecure.cpp.o" ^
 "ssl_client.cpp.o" ^
 "DNSServer.cpp.o" ^
 "_Base64.cpp.o" ^
 "EEPROM.cpp.o" ^
 "AsyncTCP.cpp.o" ^
 "AsyncEventSource.cpp.o" ^
 "AsyncWebSocket.cpp.o" ^
 "SPIFFSEditor.cpp.o" ^
 "WebAuthentication.cpp.o" ^
 "WebHandlers.cpp.o" ^
 "WebRequest.cpp.o" ^
 "WebResponses.cpp.o" ^
 "WebServer.cpp.o" ^
 "arduino_core.a" ^
 -lgcc ^
 -lesp_websocket_client ^
 -lwpa2 ^
 -ldetection ^
 -lesp_https_server ^
 -lwps ^
 -lhal ^
 -lconsole ^
 -lpe ^
 -lsoc ^
 -lsdmmc ^
 -lpthread ^
 -llog ^
 -lesp_http_client ^
 -ljson ^
 -lmesh ^
 -lesp32-camera ^
 -lnet80211 ^
 -lwpa_supplicant ^
 -lc ^
 -lmqtt ^
 -lcxx ^
 -lesp_https_ota ^
 -lulp ^
 -lefuse ^
 -lpp ^
 -lmdns ^
 -lbt ^
 -lwpa ^
 -lspiffs ^
 -lheap ^
 -limage_util ^
 -lunity ^
 -lrtc ^
 -lmbedtls ^
 -lface_recognition ^
 -lnghttp ^
 -ljsmn ^
 -lopenssl ^
 -lcore ^
 -lfatfs ^
 -lm ^
 -lprotocomm ^
 -lsmartconfig ^
 -lxtensa-debug-module ^
 -ldl ^
 -lesp_event ^
 -lesp-tls ^
 -lfd ^
 -lespcoredump ^
 -lesp_http_server ^
 -lfr ^
 -lsmartconfig_ack ^
 -lwear_levelling ^
 -ltcp_transport ^
 -llwip ^
 -lphy ^
 -lvfs ^
 -lcoap ^
 -lesp32 ^
 -llibsodium ^
 -lbootloader_support ^
 -ldriver ^
 -lcoexist ^
 -lasio ^
 -lod ^
 -lmicro-ecc ^
 -lesp_ringbuf ^
 -ldetection_cat_face ^
 -lapp_update ^
 -lespnow ^
 -lface_detection ^
 -lapp_trace ^
 -lnewlib ^
 -lbtdm_app ^
 -lwifi_provisioning ^
 -lfreertos ^
 -lfreemodbus ^
 -lethernet ^
 -lnvs_flash ^
 -lspi_flash ^
 -lc_nano ^
 -lexpat ^
 -lfb_gfx ^
 -lprotobuf-c ^
 -lesp_adc_cal ^
 -ltcpip_adapter ^
 -lstdc++ ^
 -Wl,--end-group ^
 -Wl,-EL ^
 -o "esp-ir.ino.elf"

"%ESP32_PATH%\tools\esptool_py\3.0.0/esptool.exe" ^
 --chip esp32 elf2image --flash_mode dio --flash_freq 80m --flash_size 4MB ^
 -o "esp-ir.ino.bin" "esp-ir.ino.elf"

"%ESP32_PATH%\hardware\esp32\1.0.6/tools/gen_esp32part.exe" -q "partitions.csv" "esp-ir.ino.partitions.bin"


