lua-osx/Makefile

64 lines
1.6 KiB
Makefile
Raw Permalink Normal View History

2022-12-11 18:58:11 +01:00
# 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: README.md config.ld osx.c
$(LDOC) .
doc: doc/index.html
2022-12-11 18:58:11 +01:00
install:
-$(MKDIR) $(DESTDIR)$(LIBDIR)/include
$(CP) $(lib) $(DESTDIR)$(LIBDIR)/
$(CP) osx.h osx_dir.h $(DESTDIR)$(LIBDIR)/include/
2022-12-11 18:58:11 +01:00
uninstall:
-$(RM) $(DESTDIR)$(LIBDIR)/$(lib)
-$(RM) $(DESTDIR)$(LIBDIR)/include/osx.h $(DESTDIR)$(LIBDIR)/include/osx_dir.h
-$(RMDIR) $(DESTDIR)$(LIBDIR)/include
2022-12-11 18:58:11 +01:00
clean:
2022-12-14 12:46:15 +01:00
-$(RM) -R doc
2022-12-11 18:58:11 +01:00
-$(RM) $(lib) $(o) $(_o)