"How do I only use avr-gcc?"
In the IDE, open File:Preferences and turn on Verbose outputs.
Compile a simple sketch.
You will see all the commands that are being executed, some of which are the avr-gcc commands.
Copy & save those, experiment with running them with the avr-gcc environment.