Released version 3-2014010504
[notion/jeffpc.git] / libextl / Makefile
blobc8e169fd78df27ab6bae8c7cd1879c8fc93cd667
1 ##
2 ## Extl Makefile
3 ##
5 ifeq ($(MAKELEVEL),0)
6 TOPDIR=.
7 else
8 TOPDIR=..
9 endif
11 # System-specific configuration
12 include $(TOPDIR)/build/system-inc.mk
14 ######################################
16 INCLUDES += $(LIBTU_INCLUDES) $(LUA_INCLUDES)
18 CFLAGS += $(XOPEN_SOURCE) $(C99_SOURCE)
20 SOURCES=readconfig.c luaextl.c misc.c
22 HEADERS=readconfig.h extl.h luaextl.h private.h types.h
24 TARGETS=libextl.a libextl-mkexports
26 .PHONY : libextl-mkexports test
28 ######################################
30 include $(TOPDIR)/build/rules.mk
32 ######################################
34 ifdef LUA
36 libextl.a: $(OBJS)
37 $(AR) $(ARFLAGS) $@ $+
38 $(RANLIB) $@
40 libextl-mkexports: libextl-mkexports.in
41 sed "1s:LUA50:$(LUA):" $< > $@
43 else
45 libextl.a: libextl-mkexports.in
46 echo "Error: LUA interpreter and libraries not found (or inconsistent versions)"
47 return -1
49 libextl-mkexports: libextl-mkexports.in
50 echo "Error: LUA interpreter and libraries not found (or inconsistent versions)"
51 return -1
53 endif
55 install:
56 $(INSTALLDIR) $(DESTDIR)$(BINDIR)
57 $(INSTALL) -m $(BIN_MODE) libextl-mkexports $(DESTDIR)$(BINDIR)
58 $(INSTALLDIR) $(DESTDIR)$(LIBDIR)
59 $(INSTALL) -m $(DATA_MODE) libextl.a $(DESTDIR)$(LIBDIR)
60 $(INSTALLDIR) $(DESTDIR)$(INCDIR)
61 for h in $(HEADERS); do \
62 $(INSTALL) -m $(DATA_MODE) $$h $(DESTDIR)$(INCDIR); \
63 done
65 test:
66 rm test/extltest
67 gcc -g -o test/extltest test/extltest.c `pkg-config --libs lua5.1` `pkg-config --cflags lua5.1` -ltu
68 test/extltest
69 rm test/extltest
70 gcc -g -o test/extltest test/extltest.c `pkg-config --libs lua5.2` `pkg-config --cflags lua5.2` -ltu
71 test/extltest