From be8324ff71b135fa625c92a31fd95fc38f25dac5 Mon Sep 17 00:00:00 2001 From: Andrea Luzzardi Date: Tue, 10 Oct 2006 21:32:21 +0000 Subject: [PATCH] Better makefile --- Makefile | 28 ++++++++++++++++++++++++++++ src/Makefile | 20 -------------------- 2 files changed, 28 insertions(+), 20 deletions(-) create mode 100644 Makefile delete mode 100644 src/Makefile diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..860448b --- /dev/null +++ b/Makefile @@ -0,0 +1,28 @@ +DEBUG := no +SRCS := src/test.c \ + src/conf.c \ + src/log.c \ + src/xpath.c \ + src/hal.c \ + src/pad.c \ + src/volume.c \ + src/device.c +OBJS := $(SRCS:.c=.o) +NAME := pusb_check +CC := gcc +CFLAGS := -Wall `pkg-config --cflags hal` `pkg-config --cflags libxml-2.0` +LDFLAGS := `pkg-config --libs hal-storage` `pkg-config --libs libxml-2.0` + +ifeq (yes, ${DEBUG}) + CFLAGS := ${CFLAGS} -ggdb +endif + +all : $(NAME) +$(NAME) : $(OBJS) + $(CC) -o $(NAME) $(LDFLAGS) $(OBJS) + +%.o : %.c + ${CC} -c ${CFLAGS} $< -o $@ + +clean : + rm -f $(OBJS) \ No newline at end of file diff --git a/src/Makefile b/src/Makefile deleted file mode 100644 index f14a372..0000000 --- a/src/Makefile +++ /dev/null @@ -1,20 +0,0 @@ -SRC = test.c \ - conf.c \ - log.c \ - xpath.c \ - hal.c \ - pad.c \ - volume.c \ - device.c -OBJ = $(SRC:.c=.o) -NAME = test -CC = gcc -CFLAGS = -Wall `pkg-config --cflags hal` `pkg-config --cflags libxml-2.0` -ggdb -LDFLAGS = `pkg-config --libs hal-storage` `pkg-config --libs libxml-2.0` - -all : $(NAME) -$(NAME) : $(OBJ) - $(CC) -o $(NAME) $(LDFLAGS) $(OBJ) - -clean : - rm -f $(OBJ) \ No newline at end of file