This repository was archived by the owner on Aug 15, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 22
Expand file tree
/
Copy pathMakefile
More file actions
48 lines (39 loc) · 1.24 KB
/
Makefile
File metadata and controls
48 lines (39 loc) · 1.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
TARGET=e
BUILDDIR=bin/
STXDIR=$(HOME)/.estx
ERC=$(HOME)/.erc
PREFIX=/usr/local/bin/
SOURCES=$(wildcard src/*.c)
MAIN=main.c
LUA_FLAGS=
LUA_OPT=generic
override CFLAGS+=-Werror -Wall -g -fPIC -O2 -DNDEBUG -ftrapv -Wfloat-equal -Wundef -Wwrite-strings -Wuninitialized -pedantic -std=c11
OS := $(shell uname)
DE := $(shell echo $(DESKTOP_SESSION))
ifeq ($(OS),$(filter $(OS), FreeBSD OpenBSD NetBSD))
CADDFLAG += -lexecinfo
else ifeq ($(OS),$(filter $(OS), Linux))
LUA_FLAGS += -lm
endif
ifeq ($(DE),gnome)
CADDFLAG += `pkg-config --libs --cflags gtk+-3.0` `pkg-config --libs gtk+-3.0`
DE_FLAG := -Dgnome
endif
all: main.c syntax
$(info DE is $(DE))
mkdir -p $(BUILDDIR)
$(CC) $(MAIN) $(SOURCES) -DSTXDIR=\"$(STXDIR)\" -o $(BUILDDIR)$(TARGET) $(CFLAGS) $(CADDFLAG) $(DE_FLAG)
lua:
cd ./vendor/lua-5.3.4/src && make clean && make $(LUA_OPT)
make all CFLAGS+="-DWITH_LUA -L./vendor/lua-5.3.4/src -llua $(LUA_FLAGS)"
syntax:
mkdir -p $(STXDIR)
cp stx/* $(STXDIR)
install: all
install $(BUILDDIR)$(TARGET) $(PREFIX)$(TARGET)
install_lua:
cd ./vendor/lua-5.3.4/src && make clean && make $(LUA_OPT) $(LUA_FLAGS)
make install CFLAGS+="-DWITH_LUA -L./vendor/lua-5.3.4/src -llua -DERC=\"$(ERC)\" $(LUA_FLAGS)"
touch ~/.erc
uninstall:
rm -rf $(PREFIX)$(TARGET)