0

I'm creating a group of ATMega devices with different programs. They share lot's of files like classes.

I want to create a makfile that will contain something like:

DEVICE1DEPS = first.o second.o thrid.o
DEVICE2DEPS = second.o thrid.o fourth.o
...

Then I want to be able to write make device1 and have

$(CC) $(CFLAGS) -I./ -o device1.out $(device1deps)

I also have a rule called program to write my program on chip I want to be able to write make device1 program / make program device1 to execute

avrdude -p t2313 -c dapa -e -U flash:w:device1.hex

How to do that?

peku33
  • 3,628
  • 3
  • 26
  • 44

1 Answers1

0

You can make two program targets: program1 and program2, and make them depend on device1 and device2 respectively. Then when you make program1 you will also invoke device1 automatically.

Some programmer dude
  • 400,186
  • 35
  • 402
  • 621