Compare commits
3 Commits
7634b3df93
...
0b1b8f60a4
Author | SHA1 | Date |
---|---|---|
nekobit | 0b1b8f60a4 | |
nekobit | 9518274848 | |
nekobit | 78c09fd7dc |
|
@ -1,3 +1,4 @@
|
|||
Makefile
|
||||
template
|
||||
ctemplate
|
||||
filec
|
||||
|
@ -15,3 +16,4 @@ templates/*.ctt
|
|||
test/unit/*.bin
|
||||
compile_commands.json
|
||||
build/
|
||||
obj/
|
||||
|
|
34
Makefile
34
Makefile
|
@ -1,34 +0,0 @@
|
|||
# GNU Make solution makefile autogenerated by Premake
|
||||
# Type "make help" for usage help
|
||||
|
||||
ifndef config
|
||||
config=debug
|
||||
endif
|
||||
export config
|
||||
|
||||
PROJECTS := treebird
|
||||
|
||||
.PHONY: all clean help $(PROJECTS)
|
||||
|
||||
all: $(PROJECTS)
|
||||
|
||||
treebird:
|
||||
@echo "==== Building treebird ($(config)) ===="
|
||||
@${MAKE} --no-print-directory -C . -f treebird.make
|
||||
|
||||
clean:
|
||||
@${MAKE} --no-print-directory -C . -f treebird.make clean
|
||||
|
||||
help:
|
||||
@echo "Usage: make [config=name] [target]"
|
||||
@echo ""
|
||||
@echo "CONFIGURATIONS:"
|
||||
@echo " debug"
|
||||
@echo " release"
|
||||
@echo ""
|
||||
@echo "TARGETS:"
|
||||
@echo " all (default)"
|
||||
@echo " clean"
|
||||
@echo " treebird"
|
||||
@echo ""
|
||||
@echo "For more information, see http://industriousone.com/premake/quick-start"
|
26
premake4.lua
26
premake4.lua
|
@ -26,7 +26,7 @@ local c_files = {
|
|||
'request.c',
|
||||
'session.c',
|
||||
'path.c',
|
||||
'mime.c'
|
||||
'mime.c',
|
||||
};
|
||||
|
||||
-- Not actually real 'pages', but the ones we compile in / create definitions
|
||||
|
@ -71,15 +71,29 @@ for i=1, table.getn(pages) do pages[i] = 'src/'.. pages[i] end
|
|||
project("treebird");
|
||||
kind("ConsoleApp");
|
||||
language("C");
|
||||
--files { table.unpack(c_files), table.unpack(pages) };
|
||||
-- Merge pages into c_files
|
||||
for _, v in ipairs(pages) do
|
||||
table.insert(c_files, v);
|
||||
end
|
||||
files(c_files);
|
||||
files(pages);
|
||||
includedirs { "include/" };
|
||||
defines(definitions);
|
||||
|
||||
configuration { "linux", "bsd", "gmake" };
|
||||
linkoptions { "`pkg-config --libs mastodont`" };
|
||||
-- TODO figure out perl...
|
||||
-- For some reason this one doesn't have a pkg-config file
|
||||
local libfcgi = os.findlib("libfcgi");
|
||||
if not libfcgi then
|
||||
print("Couldn't find libfcgi (aka fcgi-devkit). Probably gonna need that.\n");
|
||||
os.exit(1);
|
||||
end
|
||||
|
||||
configuration { "gmake" };
|
||||
linkoptions{ "`pkg-config --libs mastodont` `perl -MExtUtils::Embed -e ldopts`" };
|
||||
buildoptions{ "`pkg-config --cflags mastodont` `perl -MExtUtils::Embed -e ccopts`" };
|
||||
links{"fcgi"};
|
||||
|
||||
if premake.gcc.cc ~= 'clang' then
|
||||
buildoptions{"-Wno-compound-token-split-by-macro"};
|
||||
end
|
||||
|
||||
configuration { "Debug" };
|
||||
defines { "DEBUG" };
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
#ifndef GLOBAL_PERL_H
|
||||
#define GLOBAL_PERL_H
|
||||
|
||||
// Hack on my system... if this breaks anything, plz dig deeper
|
||||
/* Libperl has lots of warnings... */
|
||||
#include <EXTERN.h>
|
||||
#include <perl.h>
|
||||
#include "memory.h"
|
||||
|
|
|
@ -26,12 +26,12 @@ ifeq ($(config),debug)
|
|||
DEFINES += -DCMP_ENABLE_ABOUT -DCMP_ENABLE_ACCOUNT -DCMP_ENABLE_APPLICATIONS -DCMP_ENABLE_ATTACHMENTS -DCMP_ENABLE_BASE_PAGE -DCMP_ENABLE_CONVERSATIONS -DCMP_ENABLE_EMOJI -DCMP_ENABLE_EMOJI_REACTION -DCMP_ENABLE_GLOBAL_CACHE -DCMP_ENABLE_GLOBAL_PERL -DCMP_ENABLE_HASHTAG -DCMP_ENABLE_HTTP -DCMP_ENABLE_INDEX -DCMP_ENABLE_LISTS -DDEBUG
|
||||
INCLUDES += -Iinclude
|
||||
ALL_CPPFLAGS += $(CPPFLAGS) -MMD -MP $(DEFINES) $(INCLUDES)
|
||||
ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -g
|
||||
ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -g `pkg-config --cflags mastodont` `perl -MExtUtils::Embed -e ccopts` -Wno-compound-token-split-by-macro
|
||||
ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CFLAGS)
|
||||
ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES)
|
||||
ALL_LDFLAGS += $(LDFLAGS)
|
||||
ALL_LDFLAGS += $(LDFLAGS) -L. `pkg-config --libs mastodont` `perl -MExtUtils::Embed -e ldopts`
|
||||
LDDEPS +=
|
||||
LIBS += $(LDDEPS)
|
||||
LIBS += $(LDDEPS) -lfcgi
|
||||
LINKCMD = $(CC) -o $(TARGET) $(OBJECTS) $(RESOURCES) $(ARCH) $(ALL_LDFLAGS) $(LIBS)
|
||||
define PREBUILDCMDS
|
||||
endef
|
||||
|
@ -48,12 +48,12 @@ ifeq ($(config),release)
|
|||
DEFINES += -DCMP_ENABLE_ABOUT -DCMP_ENABLE_ACCOUNT -DCMP_ENABLE_APPLICATIONS -DCMP_ENABLE_ATTACHMENTS -DCMP_ENABLE_BASE_PAGE -DCMP_ENABLE_CONVERSATIONS -DCMP_ENABLE_EMOJI -DCMP_ENABLE_EMOJI_REACTION -DCMP_ENABLE_GLOBAL_CACHE -DCMP_ENABLE_GLOBAL_PERL -DCMP_ENABLE_HASHTAG -DCMP_ENABLE_HTTP -DCMP_ENABLE_INDEX -DCMP_ENABLE_LISTS -DNDEBUG
|
||||
INCLUDES += -Iinclude
|
||||
ALL_CPPFLAGS += $(CPPFLAGS) -MMD -MP $(DEFINES) $(INCLUDES)
|
||||
ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -O2
|
||||
ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -O2 `pkg-config --cflags mastodont` `perl -MExtUtils::Embed -e ccopts` -Wno-compound-token-split-by-macro
|
||||
ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CFLAGS)
|
||||
ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES)
|
||||
ALL_LDFLAGS += $(LDFLAGS) -s
|
||||
ALL_LDFLAGS += $(LDFLAGS) -L. -s `pkg-config --libs mastodont` `perl -MExtUtils::Embed -e ldopts`
|
||||
LDDEPS +=
|
||||
LIBS += $(LDDEPS)
|
||||
LIBS += $(LDDEPS) -lfcgi
|
||||
LINKCMD = $(CC) -o $(TARGET) $(OBJECTS) $(RESOURCES) $(ARCH) $(ALL_LDFLAGS) $(LIBS)
|
||||
define PREBUILDCMDS
|
||||
endef
|
||||
|
|
Loading…
Reference in New Issue