From ac8d14bc26911b96578a0e919a74522920f6b637 Mon Sep 17 00:00:00 2001 From: Babak Farrokhi Date: Sun, 1 Nov 2015 12:03:57 +0330 Subject: [PATCH] - Improve Makefile - Indenting --- Makefile | 11 ++++++----- pidutil.c | 2 +- pidutil.h | 12 ++++++------ 3 files changed, 13 insertions(+), 12 deletions(-) diff --git a/Makefile b/Makefile index d7ebacb..cbb4446 100644 --- a/Makefile +++ b/Makefile @@ -5,15 +5,16 @@ LDFLAGS=-L$(PREFIX)/lib CFLAGS=-Wall -Wextra -g -O2 -pipe -funroll-loops -ffast-math -fno-strict-aliasing CFLAGS+=$(CPPFLAGS) RANLIB?=ranlib +RM?=rm -f LIBPIDUTIL = libpidutil.a HEADERS = pidutil.h -OBJS = pidutil.o +OBJECTS = pidutil.o all: $(LIBPIDUTIL) -$(LIBPIDUTIL) : $(OBJS) - $(AR) rv $(LIBPIDUTIL) $? +$(LIBPIDUTIL) : $(OBJECTS) + $(AR) $(ARFLAGS) $(LIBPIDUTIL) $? $(RANLIB) $(LIBPIDUTIL) install: all @@ -21,5 +22,5 @@ install: all install -C $(HEADERS) $(PREFIX)/include clean: - rm -f *.o *.a a.out core temp.* $(LIBPIDUTIL) - rm -fr *.dSYM + $(RM) *.o *.a a.out core temp.* $(LIBPIDUTIL) + $(RM) -r *.dSYM diff --git a/pidutil.c b/pidutil.c index 70f112d..3b06e55 100644 --- a/pidutil.c +++ b/pidutil.c @@ -13,7 +13,7 @@ static int _pidfile_remove(struct pidfh *pfh, int freeit); #define PROGNAME program_invocation_short_name #else #define PROGNAME getprogname() -#endif /* __linux__ */ +#endif /* __linux__ */ static int pidfile_verify(const struct pidfh *pfh) diff --git a/pidutil.h b/pidutil.h index d1975d7..0eac189 100644 --- a/pidutil.h +++ b/pidutil.h @@ -24,12 +24,12 @@ struct pidfh; -int flopen(const char *_path, int _flags, ...); +int flopen(const char *_path, int _flags,...); struct pidfh *pidfile_open(const char *path, mode_t mode, pid_t *pidptr); -int pidfile_write(struct pidfh *pfh); -int pidfile_close(struct pidfh *pfh); -int pidfile_remove(struct pidfh *pfh); -int pidfile_fileno(const struct pidfh *pfh); +int pidfile_write(struct pidfh *pfh); +int pidfile_close(struct pidfh *pfh); +int pidfile_remove(struct pidfh *pfh); +int pidfile_fileno(const struct pidfh *pfh); -#endif /* _PIDUTIL_H */ +#endif /* _PIDUTIL_H */