Buy a bunch of lyres of building and hire some minstrals who can read schematics or at least have them explaind to them. Lyre of building is fairly cheap useable once per week, every hour? of playing equals 100 men working for like 1 week, perform lyre checks allow you to play it for a continuous lenght of time past 1 hour.
I'ts based off the fabricate spell, bust a bunch of those through scrolls, staves, spells etc, and all you need is a rocky cliff face from which to gain the materials(rock) and you got yourself a castle.
I know it fits the genre to some degree but I think it was patton in WW2 who said only fools use a stationary fortress in modern warfare. The french found out how dumb it was when they got over run like they were school girls. Considering the magic, mosters etc. in a d&d game I think the same rules would apply. Castles etc, mainly for show and a base of opperations druing non war times a place to train etc., but all protection and warfare occures on the field in a semi mobile fashion.