]> Git repositories of Nishi - tewi.git/commitdiff
adding stuff
authorNishi <nishi@nishi.boats>
Fri, 13 Sep 2024 08:38:39 +0000 (08:38 +0000)
committerNishi <nishi@nishi.boats>
Fri, 13 Sep 2024 08:38:39 +0000 (08:38 +0000)
git-svn-id: file:///raid/svn-personal/tewi/trunk@2 8739d7e6-ffea-ec47-b151-bdff447c6205

.clang-format [new file with mode: 0644]
Common/Makefile [new file with mode: 0644]
Common/string.c [new file with mode: 0644]
Makefile [new file with mode: 0644]
Platform/generic.mk [new file with mode: 0644]
Server/Makefile [new file with mode: 0644]
Server/main.c [new file with mode: 0644]

diff --git a/.clang-format b/.clang-format
new file mode 100644 (file)
index 0000000..f09c9d2
--- /dev/null
@@ -0,0 +1,15 @@
+---
+# $Id$
+Language: Cpp
+UseTab: Always
+TabWidth: 8
+IndentWidth: 8
+PointerAlignment: Left
+ColumnLimit: 1024
+AllowShortIfStatementsOnASingleLine: Always
+AllowShortBlocksOnASingleLine: Never
+AllowShortLoopsOnASingleLine: true
+SpaceBeforeParens: Never
+AlignEscapedNewlines: DontAlign
+SortIncludes: false
+AllowShortEnumsOnASingleLine: false
diff --git a/Common/Makefile b/Common/Makefile
new file mode 100644 (file)
index 0000000..f9243e9
--- /dev/null
@@ -0,0 +1,19 @@
+# $Id$
+
+include $(PWD)/Platform/$(PLATFORM).mk
+
+.PHONY: all clean
+.SUFFIXES: .c .o
+
+OBJS = string.o
+
+all: common.a
+
+common.a: $(OBJS)
+       ar rcs $@ $(OBJS)
+
+.c.o:
+       $(CC) $(CFLAGS) -c -o $@ $<
+
+clean:
+       rm -f *.o *.a
diff --git a/Common/string.c b/Common/string.c
new file mode 100644 (file)
index 0000000..a0749a0
--- /dev/null
@@ -0,0 +1 @@
+/* $Id$ */
diff --git a/Makefile b/Makefile
new file mode 100644 (file)
index 0000000..496f459
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,24 @@
+# $Id$
+
+PWD = `pwd`
+PLATFORM = generic
+PREFIX = /usr
+
+FLAGS = PWD=$(PWD) PLATFORM=$(PLATFORM) PREFIX=$(PREFIX)
+
+.PHONY: all format clean ./Server ./Common
+
+all: ./Server
+
+./Server:: ./Common
+       $(MAKE) -C $@ $(FLAGS)
+
+./Common::
+       $(MAKE) -C $@ $(FLAGS)
+
+format:
+       clang-format --verbose -i `find . -name "*.c" -or -name "*.h"`
+
+clean:
+       $(MAKE) -C ./Server $(FLAGS) clean
+       $(MAKE) -C ./Common $(FLAGS) clean
diff --git a/Platform/generic.mk b/Platform/generic.mk
new file mode 100644 (file)
index 0000000..717b4c6
--- /dev/null
@@ -0,0 +1,7 @@
+# $Id$
+
+CC = cc
+AR = ar
+CFLAGS = -g -std=c99 -DPREFIX=\"$(PREFIX)\"
+LDFLAGS =
+LIBS =
diff --git a/Server/Makefile b/Server/Makefile
new file mode 100644 (file)
index 0000000..974d35a
--- /dev/null
@@ -0,0 +1,19 @@
+# $Id$
+
+include $(PWD)/Platform/$(PLATFORM).mk
+
+.PHONY: all clean
+.SUFFIXES: .c .o
+
+OBJS = ../Common/common.a main.o
+
+all: tewi$(EXEC)
+
+tewi$(EXEC): $(OBJS)
+       $(CC) $(LDFLAGS) -o $@ $(OBJS) $(LIBS)
+
+.c.o:
+       $(CC) $(CFLAGS) -c -o $@ $<
+
+clean:
+       rm -f *.o tewi *.exe
diff --git a/Server/main.c b/Server/main.c
new file mode 100644 (file)
index 0000000..db19da6
--- /dev/null
@@ -0,0 +1,3 @@
+/* $Id$ */
+
+int main() {}