Linux-kernel mailing list archive 2000-15,: Re: Multiple .o files from single .c file - how?

# Re: Multiple .o files from single .c file - how?

Peter Samuelson (peter@cadcamlab.org)
09 Apr 2000 01:37:07 -0500

- Messages sorted by: [ date ][ thread ][ subject ][ author ]
- Next message: Anthony Barbachan: "Re: Suggested dual human/binary interface for proc/devfs"
- Previous message: Andre Hedrick: "Re: Linux 2.4 Jobs Update"
- In reply to: Krzysztof Halasa: "Re: Multiple .o files from single .c file - how?"
- Next in thread: Krzysztof Halasa: "Re: Multiple .o files from single .c file - how?"
- Reply: Krzysztof Halasa: "Re: Multiple .o files from single .c file - how?"

[willy@thepuffingroup.com]
> > CFLAGS_init_task0.o = -DALIGN=0
> > CFLAGS_init_task1.o = -DALIGN=1
> > CFLAGS_init_task2.o = -DALIGN=2
> > CFLAGS_init_task3.o = -DALIGN=3
> >
> > init_task0.o init_task1.o init_task2.o init_task3.o : init_task.c
> > $(CC) $(CFLAGS) $(EXTRA_CFLAGS) $(CFLAGS_$@) -c -o $@ $<

[Krzysztof Halasa <khc@intrepid.pm.waw.pl>]
> But it seems you have to list all .h dependencies here - make dep generates
> dependencies for init_task.o and not for init_task[0123].o.

OK, have *one* of your .o files be the "natural" filename, and use the
dependencies from that:

CFLAGS_init_task.o = -DALIGN=0
CFLAGS_init_task1.o = -DALIGN=1
CFLAGS_init_task2.o = -DALIGN=2
CFLAGS_init_task3.o = -DALIGN=3

init_task1.o init_task2.o init_task3.o : init_task.o
init_task1.o init_task2.o init_task3.o init_task.o : init_task.c
$(CC) $(CFLAGS) $(EXTRA_CFLAGS) $(CFLAGS_$@) -c -o $@ $<

Peter

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

- Next message: Anthony Barbachan: "Re: Suggested dual human/binary interface for proc/devfs"
- Previous message: Andre Hedrick: "Re: Linux 2.4 Jobs Update"
- In reply to: Krzysztof Halasa: "Re: Multiple .o files from single .c file - how?"
- Next in thread: Krzysztof Halasa: "Re: Multiple .o files from single .c file - how?"
- Reply: Krzysztof Halasa: "Re: Multiple .o files from single .c file - how?"