diff options
author | Mike Harsch <mike@harschsystems.com> | 2012-10-22 14:33:03 -0600 |
---|---|---|
committer | Mike Harsch <mike@harschsystems.com> | 2012-10-22 14:33:03 -0600 |
commit | c4a43ebf9af7590c8d871ae97e095ea27495811d (patch) | |
tree | 1f11c8a970ea352ea6f9e68f5b00ec745f28ce92 | |
parent | 9ff3bfe146e17ec2eb6fc56a7373118a2703a002 (diff) | |
download | libnvpair-c4a43ebf9af7590c8d871ae97e095ea27495811d.tar.gz |
add Makefile
-rw-r--r-- | Makefile | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..727339f --- /dev/null +++ b/Makefile @@ -0,0 +1,35 @@ +CC = /usr/bin/gcc +DEBUG_FLAGS = -g +WARN_FLAGS = -Wall +PIC_FLAGS = -fPIC +OPT_FLAGS = -O2 +C_STDFLAGS = -std=c99 + +CFLAGS = $(DEBUG_FLAGS) \ + $(WARN_FLAGS) \ + $(PIC_FLAGS) \ + $(OPT_FLAGS) \ + $(C_STDFLAGS) + +STD_DEFS = -D_GNU_SOURCE -D__EXTENSION__ +LF64_DEFS = -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 +PIC_DEFS = -DPIC + +CPPFLAGS = $(STD_DEFS) $(LF64_DEFS) $(PIC_DEFS) + +SRCS = nvpair.c \ + nvpair_alloc_system.c \ + libnvpair.c + +OBJS = $(SRCS:.c=.o) + +all: libnvpair.a + +libnvpair.a: $(OBJS) + ar rcs libnvpair.a $(OBJS) + +%.o: %.c + $(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $< + +clean: + rm -f $(OBJS) libnvpair.a |