From b7ef2d8f80957543fb7440fbcafa9f92509c21ad Mon Sep 17 00:00:00 2001 From: Nishi Date: Fri, 13 Sep 2024 08:38:39 +0000 Subject: [PATCH] adding stuff git-svn-id: file:///raid/svn-personal/tewi/trunk@2 8739d7e6-ffea-ec47-b151-bdff447c6205 --- .clang-format | 15 +++++++++++++++ Common/Makefile | 19 +++++++++++++++++++ Common/string.c | 1 + Makefile | 24 ++++++++++++++++++++++++ Platform/generic.mk | 7 +++++++ Server/Makefile | 19 +++++++++++++++++++ Server/main.c | 3 +++ 7 files changed, 88 insertions(+) create mode 100644 .clang-format create mode 100644 Common/Makefile create mode 100644 Common/string.c create mode 100644 Makefile create mode 100644 Platform/generic.mk create mode 100644 Server/Makefile create mode 100644 Server/main.c diff --git a/.clang-format b/.clang-format new file mode 100644 index 0000000..f09c9d2 --- /dev/null +++ b/.clang-format @@ -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 index 0000000..f9243e9 --- /dev/null +++ b/Common/Makefile @@ -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 index 0000000..a0749a0 --- /dev/null +++ b/Common/string.c @@ -0,0 +1 @@ +/* $Id$ */ diff --git a/Makefile b/Makefile new file mode 100644 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 index 0000000..717b4c6 --- /dev/null +++ b/Platform/generic.mk @@ -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 index 0000000..974d35a --- /dev/null +++ b/Server/Makefile @@ -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 index 0000000..db19da6 --- /dev/null +++ b/Server/main.c @@ -0,0 +1,3 @@ +/* $Id$ */ + +int main() {}