Re: [xml] makefile sample



Christoph Gysin wrote:

test: test.o gcc -o test test.o $(shell pkg-config --libs libxml-2.0)

test.o: test.c
        gcc -c test.c $(shell pkg-config --cflags libxml-2.0)

Or a little more generic (since we already are using gmake constructs)

SRCS    += myprogram.c
OBJS    += $(SRCS:.c=.o)
CFLAGS  += $(shell pkg-config --cflags libxml-2.0)
LIBS    += $(shell pkg-config --libs libxml-2.0)

myprogram: $(OBJS)
        $(LINK.o) -o $@ $^ $(LIBS)



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]