BarryServer : Git

All the code for all my projects
// BarryServer : Git / libBLOC / commit / b3106d3ca5d418eb70a698902e557178416aba18 / Makefile

// Related

libBLOC

Barry Initial commit b3106d3 (2 years, 11 months ago)
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..0314ac3
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,36 @@
+PRODUCT=libBLOC.a
+
+CC=gcc
+CFLAGS=-Iinclude/
+
+AR=ar
+
+SRCS := $(wildcard *.c)
+SRCS += $(wildcard **/*.c)
+OBJS = $(addprefix build/,$(SRCS:.c=.o))
+
+.PHONY: clean all install
+
+all: $(PRODUCT)
+
+clean:
+	$(info Removing object files)
+	@mkdir -p build
+	@rm -rf build
+	@touch $(PRODUCT)
+	@rm $(PRODUCT)
+
+install: $(PRODUCT)
+	$(info INSTALL $^)
+	@cp -r include/* /usr/include/
+	@install -Dm 644 $^ -t /usr/lib/
+
+$(PRODUCT): $(OBJS)
+	$(info AR $@)
+	@mkdir -p $(@D)
+	@$(AR) rcs $@ $^
+
+build/%.o: %.c
+	$(info CC $<)
+	@mkdir -p $(@D)
+	@$(CC) -c $< -o $@ $(CFLAGS)