Thierry FOURNIER | d8b5c77 | 2018-02-23 11:40:03 +0100 | [diff] [blame] | 1 | DESTDIR = |
| 2 | PREFIX = /usr/local |
| 3 | BINDIR = $(PREFIX)/bin |
| 4 | |
| 5 | CC = gcc |
| 6 | LD = $(CC) |
| 7 | |
| 8 | CFLAGS = -g -O2 -Wall -Werror -pthread |
| 9 | LDFLAGS = -lpthread |
| 10 | |
| 11 | OBJS = spoa.o |
| 12 | |
Thierry FOURNIER | 6908c95 | 2018-02-23 15:20:55 +0100 | [diff] [blame] | 13 | ifneq ($(USE_LUA),) |
| 14 | OBJS += ps_lua.o |
| 15 | ifneq ($(LUA_INC),) |
| 16 | CFLAGS += -I$(LUA_INC) |
| 17 | endif |
| 18 | ifneq ($(LUA_LIB),) |
| 19 | LDLIBS += -L$(LUA_LIB) |
| 20 | endif |
| 21 | LDLIBS += -ldl -Wl,--export-dynamic -llua -lm -Wl,--no-export-dynamic |
| 22 | endif |
Thierry FOURNIER | d8b5c77 | 2018-02-23 11:40:03 +0100 | [diff] [blame] | 23 | |
Thierry FOURNIER | 00a0225 | 2018-02-25 20:59:57 +0100 | [diff] [blame] | 24 | ifneq ($(USE_PYTHON),) |
| 25 | OBJS += ps_python.o |
| 26 | CFLAGS += -I/usr/include/python2.7 |
| 27 | LDLIBS += -lpython2.7 |
| 28 | endif |
| 29 | |
Thierry FOURNIER | d8b5c77 | 2018-02-23 11:40:03 +0100 | [diff] [blame] | 30 | spoa: $(OBJS) |
Thierry FOURNIER | 6908c95 | 2018-02-23 15:20:55 +0100 | [diff] [blame] | 31 | $(LD) $(LDFLAGS) -o $@ $^ $(LDLIBS) |
Thierry FOURNIER | d8b5c77 | 2018-02-23 11:40:03 +0100 | [diff] [blame] | 32 | |
| 33 | install: spoa |
| 34 | install spoa $(DESTDIR)$(BINDIR) |
| 35 | |
| 36 | clean: |
| 37 | rm -f spoa $(OBJS) |
| 38 | |
| 39 | %.o: %.c |
| 40 | $(CC) $(CFLAGS) -c -o $@ $< |