From b8d546b9ed64ce173ac1cd5571d4e366044f0117 Mon Sep 17 00:00:00 2001 From: Andrea Luzzardi Date: Tue, 10 Oct 2006 21:32:21 +0000 Subject: [PATCH] Better makefile --- pam_usb/Makefile | 28 ++++++++++++++++++++++++++++ pam_usb/src/Makefile | 20 -------------------- 2 files changed, 28 insertions(+), 20 deletions(-) create mode 100644 pam_usb/Makefile delete mode 100644 pam_usb/src/Makefile diff --git a/pam_usb/Makefile b/pam_usb/Makefile new file mode 100644 index 0000000..860448b --- /dev/null +++ b/pam_usb/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/pam_usb/src/Makefile b/pam_usb/src/Makefile deleted file mode 100644 index f14a372..0000000 --- a/pam_usb/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