lua-osx/Makefile

64 lines
1.7 KiB
Makefile

# The lua-osx Makefile
# Author: Lorenzo Cogotti, The DoubleFourteen Code Forge
#
# For general configuration see config.mk.
# For system specific configuration see other config.*s.
#
# To pick a specific system configuration use the CONFIG variable
# (config.unix by default), e.g.:
# make CONFIG=config.macosx
#
# By default we build against system's lua interpreter,
# to build against other implementations use the LUA variable, e.g.:
# make LUA=luajit
#
# To manually specify lua's include path, library path and library name use:
# LUA_INCDIR, LUA_LIBDIR and LUALIB variables respectively.
# By default these are automatically detected via pkg-config.
#
# To manually specify the module install path use the LIBDIR variable,
# By default it is automatically detected via pkg-config.
#
# NOTE: there is NO support for the MSVC compiler.
CONFIG = config.unix
include config.mk
include $(CONFIG)
lib = osx.$(LIB_EXTENSION)
src = osx.c
o = $(src:.c=.o)
_o = $(_src:.c=.o)
.c.o:
$(CC) -std=c11 $(_cflags) $(CFLAGS) -c $<
all: $(lib)
$(_o): $(_src) xconf.h osx_dir.h
osx.o: osx.c xconf.h luacompat.h osx.h osx_dir.h
$(lib): $(o) $(_o)
$(LD) $(LIBFLAG) -o $@ $(_ldflags) $(LDFLAGS) $(o) $(_o)
doc/index.html: config.ld osx.c
$(LDOC) .
doc: doc/index.html
install:
-$(MKDIR) $(DESTDIR)$(LIBDIR)/osx $(DESTDIR)$(LIBDIR)/osx/include
$(CP) $(lib) $(DESTDIR)$(LIBDIR)/osx/
$(CP) osx.h osx_dir.h $(DESTDIR)$(LIBDIR)/osx/include/
uninstall:
-$(RM) $(DESTDIR)$(LIBDIR)/osx/$(lib)
-$(RM) $(DESTDIR)$(LIBDIR)/osx/include/osx.h $(DESTDIR)$(LIBDIR)/osx/include/osx_dir.h
-$(RMDIR) $(DESTDIR)$(LIBDIR)/osx/include $(DESTDIR)$(LIBDIR)/osx
clean:
-$(RM) -R doc
-$(RM) $(lib) $(o) $(_o)