summaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorAlexander Sulfrian <alexander@sulfrian.net>2011-12-06 05:37:41 +0100
committerAlexander Sulfrian <alexander@sulfrian.net>2011-12-06 05:37:41 +0100
commit915ebf954d4247c4caeaea5a7e40fce30f19e1bc (patch)
tree6341d69bfbd0159537e94e0fe19480270b913ce8 /Makefile
downloadts3db_postgres-915ebf954d4247c4caeaea5a7e40fce30f19e1bc.tar.gz
ts3db_postgres-915ebf954d4247c4caeaea5a7e40fce30f19e1bc.tar.xz
ts3db_postgres-915ebf954d4247c4caeaea5a7e40fce30f19e1bc.zip
initial import, some test
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile37
1 files changed, 37 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..14ec492
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,37 @@
+TARGET:=libts3db_own.so
+TOP:=.
+
+headers:=$(wildcard ${TOP}/*.h)
+sources:=$(wildcard ${TOP}/*.c)
+deps:=$(sources:.c=.d)
+objects:=$(sources:.c=.o)
+
+
+32BIT=-m32
+CFLAGS=-fPIC $(32BIT) -g
+LDFLAGS=-shared -Wl,-soname,$(TARGET) $(32BIT)
+
+##############################################################################
+
+.PHONY: all clean
+
+all: $(TARGET)
+
+clean:
+ -$(RM) -r $(TARGET) $(objects) $(deps)
+
+ifneq ($(MAKECMDGOALS),clean)
+-include $(deps)
+endif
+
+##############################################################################
+# normal build
+
+$(TARGET): $(objects) $(deps)
+ $(CC) $(LDFLAGS) -o $(TARGET) $(objects)
+
+%.o: %.c
+ $(CC) $(CFLAGS) -MMD -c $< -o $@
+
+%.d: %.c
+ $(CC) $(CFLAGS) -MM -c $< -MF $@