Added CMakeLists, and CLion files

This commit is contained in:
Darren VanBuren 2017-05-24 01:37:37 -07:00
parent 79732cf0d6
commit 6c44b5a2b2
5 changed files with 93 additions and 0 deletions

1
.idea/.name generated Normal file
View file

@ -0,0 +1 @@
hypercube

4
.idea/misc.xml generated Normal file
View file

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CMakeWorkspace" PROJECT_DIR="$PROJECT_DIR$" />
</project>

6
.idea/vcs.xml generated Normal file
View file

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component>
</project>

29
CMakeLists.txt Normal file
View file

@ -0,0 +1,29 @@
cmake_minimum_required(VERSION 3.6)
project(hypercube)
set(CMAKE_CXX_STANDARD 11)
add_definitions(-DUSE_LINUX_SENDFILE -DSHORT_SERVER_VERSION)
set(SOURCE_FILES
akbuf/akbuf.c
akbuf/akbuf.h
asio/AKepoll.h
asio/asio.c
asio/asio.h
cfg.c
cfg.h
config.h
dist.h
http.c
http.h
hypercube.h
log.c
log.h
main.c
net.c
net.h
tracker.c
tracker.h)
add_executable(hypercube ${SOURCE_FILES})

53
Makefile.orig Normal file
View file

@ -0,0 +1,53 @@
#DEFS=-DUSE_LINUX_SENDFILE -DWITH_MYSQL
DEFS=-DUSE_LINUX_SENDFILE -DASIO_USE_SELECT -DSHORT_SERVER_VERSION
CC=gcc
CCFLAGS=$(DEFS) -ggdb
#CCFLAGS=$(DEFS) -Wall -Werror -ggdb #-pg
LDFLAGS=-ggdb #-pg
LIBS=
#LIBS=-L/usr/local/lib/mysql -lmysqlclient
#AKEPOLLDEF=-DASIO_USE_AKEPOLL
#AKEPOLLHDR=AKepoll.h
#AKEPOLLOBJ=AKepoll.o
#AKEPOLLDIR=asio/
OBJS=main.o akbuf/akbuf.o asio/asio.o $(AKEPOLLDIR)$(AKEPOLLOBJ) net.o log.o http.o cfg.o tracker.o
all: hypercube
clean:
@rm *.o */*.o hypercube
setdist:
./setdist.sh
dist.h: setdist
dist: setdist
@rm -fr hypercube-dist
@mkdir hypercube-dist hypercube-dist/akbuf hypercube-dist/asio
cp README hypercube-dist/
cp Makefile *.[ch] *.sh hypercube-dist/
cp hypercube.cfg hypercube-dist/hypercube.cfg.dist
cp tracker.cfg hypercube-dist/tracker.cfg.dist
cp access.cfg hypercube-dist/access.cfg.dist
mv hypercube-dist/config.h hypercube-dist/config.h.dist
cp akbuf/Makefile akbuf/*.[ch] hypercube-dist/akbuf/
cp asio/Makefile asio/*.[chs] hypercube-dist/asio/
tar cvfz tracker-dist.tar.gz hypercube-dist/
@cat dist.h|cut -d' ' -f3-
@cat *.[ch] akbuf/*.[ch] asio/*.[chs] | wc -l
akbuf/akbuf.o: akbuf/akbuf.c akbuf/akbuf.h
cd akbuf; make
asio/asio.o: asio/asio.c asio/asio.h
cd asio;make AKEPOLLHDR=$(AKEPOLLHDR) AKEPOLLOBJ=$(AKEPOLLOBJ) AKEPOLLDEF=$(AKEPOLLDEF)
hypercube: $(OBJS)
$(CC) $(LDFLAGS) -o hypercube $(OBJS) $(LIBS)
hypercube.h: config.h akbuf/akbuf.h asio/asio.h net.h http.h log.h cfg.h tracker.h
main.o: main.c hypercube.h config.h
$(CC) $(CCFLAGS) -c main.c
net.o: net.c hypercube.h config.h
$(CC) $(CCFLAGS) -c net.c
log.o: log.c hypercube.h config.h
$(CC) $(CCFLAGS) -c log.c
http.o: http.c hypercube.h config.h
$(CC) $(CCFLAGS) -c http.c
cfg.o: cfg.c hypercube.h config.h
$(CC) $(CCFLAGS) -c cfg.c
tracker.o: tracker.c hypercube.h config.h tracker.h
$(CC) $(CCFLAGS) -c tracker.c