mirror of
https://github.com/bol-van/zapret2.git
synced 2026-03-13 22:03:09 +00:00
43 lines
729 B
Makefile
43 lines
729 B
Makefile
CC ?= cc
|
|
OPTIMIZE ?= -Os
|
|
CFLAGS += -std=gnu99 -s $(OPTIMIZE) -flto=auto -Wno-address-of-packed-member
|
|
LIBS = -lz -lm
|
|
SRC_FILES = *.c crypto/*.c
|
|
|
|
LUA_JIT ?= 1
|
|
|
|
.if "${LUA_JIT}" == "1"
|
|
|
|
LUAJIT_VER?=2.1
|
|
LUA_VER?=5.1
|
|
LUA_PKG:=luajit
|
|
|
|
.else
|
|
|
|
LUA_VER ?= 5.4
|
|
LUA_VER_UNDOTTED!= echo $(LUA_VER) | sed 's/\.//g'
|
|
|
|
OSNAME!=uname
|
|
.if ${OSNAME} == "OpenBSD"
|
|
LUA_PKG ?= lua$(LUA_VER_UNDOTTED)
|
|
.elif ${OSNAME} == "FreeBSD"
|
|
LUA_PKG ?= lua-$(LUA_VER)
|
|
.endif
|
|
|
|
.endif
|
|
|
|
LUA_LIB!= pkg-config --libs $(LUA_PKG)
|
|
LUA_CFLAGS!= pkg-config --cflags $(LUA_PKG)
|
|
|
|
.if "${LUA_JIT}" == "1"
|
|
LUA_CFLAGS+=-DLUAJIT
|
|
.endif
|
|
|
|
all: dvtws2
|
|
|
|
dvtws2: $(SRC_FILES)
|
|
$(CC) $(CFLAGS) $(LUA_CFLAGS) -o dvtws2 $(SRC_FILES) $(LIBS) $(LUA_LIB) $(LDFLAGS)
|
|
|
|
clean:
|
|
rm -f dvtws2
|