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

From: Krzysztof Halasa (khc@intrepid.pm.waw.pl)
Date: Sun Apr 09 2000 - 06:29:33 EST


Peter Samuelson <peter@cadcamlab.org> writes:

> 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 $@ $<

All .o files must be independent - the user may enable compiling only some
of them.

It looks like making stub .c files and #including the real file.h is
the best approach here. Not that I like the idea of having full C source
in .h file.

-- 
Krzysztof Halasa
Network Administrator

- 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/



This archive was generated by hypermail 2b29 : Sat Apr 15 2000 - 21:00:12 EST