Browse Source

Better makefile

Andrea Luzzardi 18 years ago
parent
commit
be8324ff71
2 changed files with 28 additions and 20 deletions
  1. +28
    -0
      Makefile
  2. +0
    -20
      src/Makefile

+ 28
- 0
Makefile View File

@ -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)

+ 0
- 20
src/Makefile View File

@ -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)

Loading…
Cancel
Save