CFLAGS += -Wall -I$(ROOTDIR)/libxml -I$(ROOTDIR)/../../$(LINUXDIR)/drivers/char
LDFLAGS +=

SOURCES := $(wildcard *.c)

#Given these, maybe you want to know the names of their corresponding .o files:

OBJS := $(patsubst %.c, %.o, $(SOURCES))

all: $(OBJS)
	echo $(ROOTDIR)
	echo $(SOURCES)
	echo $(OBJS)
# The variable $@ has the value of the target. In this case $@ = prog

#.c.o:
%.o: %.c
	echo $(ROOTDIR)
	${CC} ${CFLAGS} -c $<
#
#depend: 
#	makedepend ${SRCS}
#

%.d: %.c
	echo $(ROOTDIR)
	echo $(SOURCES)
	echo $(OBJS)
	@set -e; rm -f $@; \
	$(CC) -MM $(CFLAGS) $< > $@.$$$$; \
	sed 's,\($*\)\.o[ :]*,\1.o $@ : ,g'< $@.$$$$ > $@; \
	rm -f $@.$$$$

clean:
	rm -f *.o core *.d* *~ 

-include $(SOURCES:.c=.d)
