.gitignore update: ignore binaries
[bluesky.git] / Makefile
index 593f4d4..fa9d6f6 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,22 +1,34 @@
-PACKAGES=glib-2.0
+LIBS3_PATH=$(HOME)/scratch/libs3-1.4/build
+PACKAGES=glib-2.0 gthread-2.0
 DEBUG=-g
-CFLAGS=-O -Wall -D_FILE_OFFSET_BITS=64 $(DEBUG) \
+CFLAGS=-O -std=gnu99 -Wall -D_FILE_OFFSET_BITS=64 $(DEBUG) \
+       $(shell pkg-config --cflags $(PACKAGES))
+CXXFLAGS=-O -Wall -D_FILE_OFFSET_BITS=64 $(DEBUG) \
        $(shell pkg-config --cflags $(PACKAGES))
 LDFLAGS=$(DEBUG) $(shell pkg-config --libs $(PACKAGES))
+SUBDIRS=nfs3
+
+SRCS=dir.c inode.c store.c
+OBJS=$(SRCS:.c=.o) s3store.o
+
+all : bluesky
+       for d in $(SUBDIRS); do $(MAKE) -C $$d; done
 
-SRCS=nfsd.c rpc.c mount.c mount_prot_xdr.c
-OBJS=$(SRCS:.c=.o)
+bluesky.a : $(OBJS)
+       $(AR) -r $@ $(OBJS)
+       ranlib $@
 
-nfsproxy : $(OBJS)
-       $(CC) $(LDFLAGS) -o $@ $^
+bluesky : main.o bluesky.a
+       $(CXX) $(LDFLAGS) -o $@ $^ -Wl,-rpath=$(LIBS3_PATH)/lib -L$(LIBS3_PATH)/lib -ls3
 
 clean :
-       rm -f $(OBJS) nfsproxy
+       rm -f $(OBJS) bluesky
+       for d in $(SUBDIRS); do $(MAKE) -C $$d clean; done
 
 dep :
        touch Makefile.dep
        makedepend -fMakefile.dep $(SRCS)
 
-.PHONY : clean dep
+.PHONY : all clean dep
 
 -include *.dep