aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLAN-TW <lantw44@gmail.com>2013-04-12 00:54:49 +0800
committerLAN-TW <lantw44@gmail.com>2013-04-12 00:54:49 +0800
commite6589bc72a2a6d4a85b23542745731a1e58cb987 (patch)
tree2b02540d852fcb074621f19223b27a1ae22a5543
parent0180ca539206b19fd3a37fe002ebe5470e5cf006 (diff)
downloadtaiwan-online-judge-lantw44-e6589bc72a2a6d4a85b23542745731a1e58cb987.tar.gz
taiwan-online-judge-lantw44-e6589bc72a2a6d4a85b23542745731a1e58cb987.tar.zst
taiwan-online-judge-lantw44-e6589bc72a2a6d4a85b23542745731a1e58cb987.zip
Add automake and libtool support in judge
-rw-r--r--.gitignore10
-rw-r--r--Makefile.am2
-rw-r--r--configure.ac5
-rw-r--r--judge/Makefile6
-rw-r--r--judge/Makefile.am28
5 files changed, 42 insertions, 9 deletions
diff --git a/.gitignore b/.gitignore
index 8997d11..595b252 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,14 +1,19 @@
*~
*.o
+*.lo
+*.la
*.so
*.ko
.*.swp
.*.swo
.*.cmd
.tmp_versions
+.deps
+.libs
Module.symvers
modules.order
aclocal.m4
+ar-lib
autoscan.log
autom4te.cache
config.log
@@ -18,6 +23,7 @@ config.status
configure
configure.scan
compile
+depcomp
install-sh
libtool
libtool.m4
@@ -32,3 +38,7 @@ stamp-h1
/Makefile.in
/include/config.h
/include/config.h.in
+/judge/Makefile
+/judge/Makefile.in
+/judge/center_server
+/judge/judge_server
diff --git a/Makefile.am b/Makefile.am
index 9159a96..c8b3cb1 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,2 +1,2 @@
ACLOCAL_AMFLAGS = -I m4
-SUBDIR = judge
+SUBDIRS = judge judgk
diff --git a/configure.ac b/configure.ac
index e6f3715..6226498 100644
--- a/configure.ac
+++ b/configure.ac
@@ -10,8 +10,9 @@ AC_CONFIG_MACRO_DIR([m4])
# Checks for programs.
AC_PROG_CC
-AM_PROG_CC_C_O
AC_PROG_CXX
+AM_PROG_CC_C_O
+AM_PROG_AR
AC_PROG_LIBTOOL
# Checks for libraries.
@@ -45,5 +46,5 @@ AC_FUNC_MALLOC
AC_FUNC_MMAP
AC_CHECK_FUNCS([dup2 getcwd memset mkdir munmap realpath rmdir socket])
-AC_CONFIG_FILES([Makefile])
+AC_CONFIG_FILES([Makefile judge/Makefile])
AC_OUTPUT
diff --git a/judge/Makefile b/judge/Makefile
deleted file mode 100644
index 3fe0444..0000000
--- a/judge/Makefile
+++ /dev/null
@@ -1,6 +0,0 @@
-all:
- g++ -I../include -g -rdynamic -fvisibility=hidden -O2 center_server.cpp center_manage.cpp center_judge.cpp tool.cpp event_exec.cpp -ldl -lpq -ltar -lbz2 -ljson -lcurl -pthread -o center_server
- g++ -I../include -g -O2 judge_server.cpp judge_manage.cpp tool.cpp -ldl -lbz2 -ltar -pthread -o judge_server
- g++ -shared -fPIC -fvisibility=hidden -O2 -I../include jmod_test_manage.cpp -ldl -ljson -pthread -o jmod_test_manage.so
- g++ -shared -fPIC -fvisibility=hidden -O2 -I../include jmod_test_line.cpp -ljson -pthread -o jmod_test_line.so
- g++ -shared -fPIC -fvisibility=hidden -O2 -I../include jmod_test_check.cpp -o jmod_test_check.so
diff --git a/judge/Makefile.am b/judge/Makefile.am
new file mode 100644
index 0000000..06a8059
--- /dev/null
+++ b/judge/Makefile.am
@@ -0,0 +1,28 @@
+bin_PROGRAMS = center_server judge_server
+
+center_server_CFLAGS = -I../include -rdynamic -fvisibility=hidden -pthread
+center_server_LDFLAGS = -pthread
+center_server_LDADD = -ldl -lpq -ltar -lbz2 -ljson -lcurl
+center_server_SOURCES = center_server.cpp center_manage.cpp center_judge.cpp tool.cpp event_exec.cpp
+
+judge_server_CFLAGS = -I../include -pthread
+judge_server_LDFLAGS = -pthread
+judge_server_LDADD = -ldl -lbz2 -ltar
+judge_server_SOURCES = judge_server.cpp judge_manage.cpp tool.cpp
+
+
+lib_LTLIBRARIES = libjmod_test_check.la libjmod_test_line.la libjmod_test_manage.la
+libjmod_test_check_la_CFLAGS = -I../include
+libjmod_test_check_la_LDFLAGS =
+libjmod_test_check_la_LIBADD =
+libjmod_test_check_la_SOURCES = jmod_test_check.cpp
+
+libjmod_test_line_la_CFLAGS = -I../include -pthread
+libjmod_test_line_la_LDFLAGS = -pthread
+libjmod_test_line_la_LIBADD = -ljson
+libjmod_test_line_la_SOURCES = jmod_test_line.cpp
+
+libjmod_test_manage_la_CFLAGS = -I../include -pthread
+libjmod_test_manage_la_LDFLAGS = -pthread
+libjmod_test_manage_la_LIBADD = -ldl -ljson
+libjmod_test_manage_la_SOURCES = jmod_test_manage.cpp