代码拉取完成,页面将自动刷新
INC=-I/usr/include/mysql
LD=g++
CXX=g++
CXXFLAGS=$(INC) -Wall -O4 -std=c++17 -DBIG_JOINS=1 -fno-strict-aliasing -DNDEBUG
LDFLAGS=
LIBS=-lbsd -L/usr/lib/x86_64-linux-gnu -lmysqlclient -lcurl -lm -lpthread
TARGET=bin/powerjudge
OBJECTS=bin/judge.o
TARGETD=bin/powerjudged
OBJECTSD=bin/judged.o
ifdef LOG_LEVEL
CXXFLAGS+= -DLOG_LEVEL=${LOG_LEVEL}
endif
ifdef FAST_JUDGE
CXXFLAGS+= -DFAST_JUDGE
endif
.PHONY: test check install sim clean
all: $(TARGET) $(TARGETD)
$(TARGET): src/judge.cpp src/log.cpp src/syscalls.cpp src/read_config.cpp src/misc.cpp src/db_updater.cpp
$(LD) -o $@ $(LDFLAGS) $^ $(LIBS) ${INC}
$(TARGETD): src/judged.cpp src/thread_safe_queue.hpp src/log.cpp src/read_config.cpp src/misc.cpp
$(LD) -o $@ $(LDFLAGS) $^ $(LIBS)
sudo chown root:root $(TARGETD)
sudo chmod 4755 $(TARGETD)
test: all
sudo chown judge:judge $(TARGET)
sudo chmod 4755 $(TARGET)
sudo setcap cap_sys_chroot+ep $(TARGET)
sudo chown -R judge:judge test/
g++ -o test/data/1405/spj test/data/1405/spj.cc
cd test && sudo su judge -c ./unitTest.sh
check: all
-cd src && ../bin/cpplint.py --linelength=100 --extensions=c,h \
--filter=-whitespace/braces,-build/include \
judge.c judge.h judged.c judged.h judge_core.h log.h misc.h syscalls.h
-cppcheck src/judge.c src/judged.c
install: all
sudo cp $(TARGET) /usr/local/bin/powerjudge
sudo chown judge:judge /usr/local/bin/powerjudge
sudo chmod 4755 /usr/local/bin/powerjudge
sudo cp $(TARGETD) /usr/local/bin/powerjudged
sudo chown root:root /usr/local/bin/powerjudged
sudo chmod 4755 /usr/local/bin/powerjudged
sudo setcap cap_sys_chroot+ep /usr/local/bin/powerjudge
# powerjudge
# must chown judge:judge
# must chmod 4755, so it will run as judge:judge
# must setcap cap_sys_chroot+ep, so chroot() can work
#
# powerjudged
# must chown root:root
# must chmod 4755
# must run with user judge
sim:
cd sim && make fresh && make exes
chmod a+x sim/sim*
sudo cp sim/sim_c.exe /usr/local/bin/sim_c
sudo cp sim/sim_java.exe /usr/local/bin/sim_java
sudo cp sim/sim_pasc.exe /usr/local/bin/sim_pas
sudo cp sim.sh /usr/local/bin
sudo chmod a+x /usr/local/bin/sim.sh
sudo rm -f /usr/local/bin/sim_cc
sudo ln -s /usr/local/bin/sim_c /usr/local/bin/sim_cc
clean:
sudo rm -f bin/judge.o bin/powerjudge bin/judged.o bin/powerjudged
sudo rm -rf test/temp
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。