forked from hjelmeland/luacrc32
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
42 lines (32 loc) · 810 Bytes
/
Makefile
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
LUA_INCLUDE = /usr/include/lua5.1
CC ?= gcc
CFLAGS1 = -fPIC
CFLAGS ?= -I . -I $(LUA_INCLUDE)
LDFLAGS1 = -shared
LDFLAGS ?=
STRIP ?= $(CROSS_COMPILE)strip
DESTDIR ?=
prefix ?= /usr
libdir ?= $(prefix)/lib
includedir ?= $(prefix)/include
lualibdir ?= $(libdir)/lua/5.1
luaincludedir ?= $(includedir)/lua5.1
INSTALL := install
INSTALL_DATA := $(INSTALL) -m 644
INSTALL_DIR := $(INSTALL) -m 755 -d
INSTALL_PROGRAM := $(INSTALL) -m 755
RM := rm -f
TARGET = crc32.so
OBJS = crc32.o wrap.o
HEADER = crc32.h
default: $(TARGET)
clean:
rm -f $(OBJS) $(TARGET)
$(TARGET): $(OBJS)
$(CC) $(LDFLAGS1) $(LDFLAGS) -o $(TARGET) $(OBJS) $(LIBS)
$(STRIP) $(TARGET)
.c.o:
$(CC) $(CFLAGS1) $(CFLAGS) -c $< -o $@
install:
$(INSTALL_DIR) $(DESTDIR)$(lualibdir)
$(INSTALL_DATA) $(TARGET) $(DESTDIR)$(lualibdir)