Browse Source

Makefile cleanup

master
Andrea Luzzardi 18 years ago
parent
commit
a4f8ebd1f5
1 changed files with 34 additions and 22 deletions
  1. +34
    -22
      pam_usb/Makefile

+ 34
- 22
pam_usb/Makefile View File

@ -1,29 +1,41 @@
DEBUG := no
SRCS := src/pusb_check.c \
src/conf.c \
src/log.c \
src/xpath.c \
src/hal.c \
src/pad.c \
src/volume.c \
src/local.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`
# Set to 'yes' to include debugging informations, e.g. DEBUG=yes make -e
DEBUG := no
# common source files
SRCS := src/conf.c \
src/log.c \
src/xpath.c \
src/hal.c \
src/pad.c \
src/volume.c \
src/local.c \
src/device.c
OBJS := $(SRCS:.c=.o)
# pusb_check
PUSB_CHECK_SRCS := src/pusb_check.c
PUSB_CHECK_OBJS := $(PUSB_CHECK_SRCS:.c=.o)
PUSB_CHECK := pusb_check
# compiler/linker options
CC := gcc
CFLAGS := -Wall `pkg-config --cflags libxml-2.0` \
`pkg-config --cflags hal-storage`
LDFLAGS := `pkg-config --libs libxml-2.0` \
`pkg-config --libs hal-storage`
ifeq (yes, ${DEBUG}) ifeq (yes, ${DEBUG})
CFLAGS := ${CFLAGS} -ggdb CFLAGS := ${CFLAGS} -ggdb
endif endif
all : $(NAME)
$(NAME) : $(OBJS)
$(CC) -o $(NAME) $(LDFLAGS) $(OBJS)
all : $(PUSB_CHECK)
$(PUSB_CHECK) : $(OBJS) $(PUSB_CHECK_OBJS)
$(CC) -o $(PUSB_CHECK) $(LDFLAGS) $(OBJS) $(PUSB_CHECK_OBJS)
%.o : %.c
${CC} -c ${CFLAGS} $< -o $@
%.o : %.c
${CC} -c ${CFLAGS} $< -o $@
clean :
rm -f $(OBJS)
clean :
rm -f $(OBJS) $(PUSB_CHECK_OBJS)

Loading…
Cancel
Save