File: Makefile

package info (click to toggle)
eja 9.5.20-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, buster, stretch
  • size: 1,340 kB
  • ctags: 3,142
  • sloc: ansic: 15,010; makefile: 255
file content (63 lines) | stat: -rw-r--r-- 1,508 bytes parent folder | download
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
prefix = /usr/local
bindir = $(prefix)/bin
sharedir = $(prefix)/share
mandir = $(sharedir)/man
man1dir = $(mandir)/man1

MYLIBS := -O2 -ldl -Wl,-E -w
MYCFLAGS := "-DLUA_USE_POSIX -DLUA_USE_DLOPEN"

PKGCONFIG_LIBS = $(shell pkg-config --silence-errors --libs lua5.2)
PKGCONFIG_CFLAGS = $(shell pkg-config --silence-errors --cflags lua5.2)

ifdef PREFIX
 CFLAGS+="-D_EJA_PATH=$(PREFIX)"
endif


all: eja


static:
	make MYCFLAGS="-DLUA_USE_POSIX" MYLIBS="-static -w"
	
	
eja: 
	@od -v -t x1 eja.lua lib/*.lua eja.lua | awk '{for(i=2;i<=NF;i++){o=o",0x"$$i}}END{print"char luaBuf[]={"substr(o,2)"};";}' > eja.h
ifeq ($(PKGCONFIG_LIBS),)	
	cd lua/src && make generic CC=$(CC) MYCFLAGS=$(MYCFLAGS) MYLIBS="$(MYLIBS)"
	$(CC) $(CFLAGS) $(CPPFLAGS) -g -o eja eja.c lua/src/liblua.a -Ilua/src/ -lm $(MYLIBS) $(LDFLAGS)
else
	$(CC) $(CFLAGS) $(CPPFLAGS) -g -o eja eja.c $(PKGCONFIG_CFLAGS) -lm $(MYLIBS) $(PKGCONFIG_LIBS) $(LDFLAGS)
endif
	
	
clean:
	@- rm -f eja
	@- rm -f eja.h 
ifeq ($(PKGCONFIG_LIBS),)		
	@- cd lua && make clean
endif	


install: eja 
	@ install -d $(DESTDIR)$(bindir) $(DESTDIR)$(man1dir)
	@ install eja $(DESTDIR)$(bindir)
	@ install doc/eja.1 $(DESTDIR)$(man1dir)


git:
	@ echo "eja.version='$(shell cat .version)'" > lib/version.lua
	@ git add .
	@- git commit


update: clean git
	@ git push
	

release: clean git 
	make update
	tar zcR /opt/eja.it/src/ > /tmp/eja-$(shell cat .version).tar.gz
	scp /tmp/eja-$(shell cat .version).tar.gz ubaldu@frs.sourceforge.net:/home/frs/project/eja/