]> Nishi Git Mirror - mandshurica.git/commitdiff
adding makefiles
authornishi <nishi@f982e544-4a7d-3444-ad1a-fde59a2a69f1>
Fri, 12 Apr 2024 15:14:00 +0000 (15:14 +0000)
committernishi <nishi@f982e544-4a7d-3444-ad1a-fde59a2a69f1>
Fri, 12 Apr 2024 15:14:00 +0000 (15:14 +0000)
git-svn-id: file:///raid/svn-main/nishi-mandshurica/trunk@3 f982e544-4a7d-3444-ad1a-fde59a2a69f1

DevForge/Makefile
Makefile
Module/Makefile [new file with mode: 0644]
Module/subversion.c [new file with mode: 0644]

index 72085ccad8193337ca0a265f1eb68e0cee745f41..2f1eef8ff88bb91b983361c67bfb899e449e70f7 100644 (file)
@@ -1,18 +1,22 @@
 # $Id$
 
+EXTRA_CFLAGS =
+EXTRA_LDFLAGS =
+EXTRA_LIBS =
+
 .PHONY: all clean
 
 ifeq ($(shell uname -s),Linux)
-LIBS += -ldl
+EXTRA_LIBS += -ldl
 endif
 
 all: ./devforge
 
 ./devforge: ./main.o
-       $(CC) $(LDFLAGS) -o $@ $< $(LIBS)
+       $(CC) $(LDFLAGS) $(EXTRA_LDFLAGS) -o $@ $< $(LIBS) $(EXTRA_LIBS)
 
 ./main.o: ./main.c ./devforge.h
-       $(CC) $(CFLAGS) -c -o $@ $<
+       $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -c -o $@ $<
 
 clean:
        rm -f ./devforge ./*.o
index 7614be3e6304980630ebb155f3feec742028103d..598a945102c92d7f4f5285a042b97df6813afaf7 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -25,5 +25,5 @@ replace:
        done
 
 clean:
-       $(MAKE) -C ./DevForge
-       $(MAKE) -C ./Module
+       $(MAKE) -C ./DevForge clean
+       $(MAKE) -C ./Module clean
diff --git a/Module/Makefile b/Module/Makefile
new file mode 100644 (file)
index 0000000..c1a1c16
--- /dev/null
@@ -0,0 +1,18 @@
+# $Id$
+
+EXTRA_CFLAGS = -fPIC
+EXTRA_LDFLAGS = -shared
+EXTRA_LIBS =
+
+.PHONY: all clean
+
+all: ./subversion.so
+
+./%.so: ./%.o
+       $(CC) $(LDFLAGS) $(EXTRA_LDFLAGS) -o $@ $^ $(LIBS) $(EXTRA_LIBS)
+
+./%.o: ./%.c
+       $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -c -o $@ $<
+
+clean:
+       rm -f *.so *.o
diff --git a/Module/subversion.c b/Module/subversion.c
new file mode 100644 (file)
index 0000000..a15a39f
--- /dev/null
@@ -0,0 +1,3 @@
+/* $Id$ */
+/* --- START LICENSE --- */
+/* --- END LICENSE --- */