-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
24 lines (18 loc) · 885 Bytes
/
Makefile
File metadata and controls
24 lines (18 loc) · 885 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
ROOT_DIR=$(CURDIR)/../..
include $(ROOT_DIR)/make.conf
INCLUDE_DIR=$(ROOT_DIR)/src/
NAME=hdf5_logger
DIRNAME=hdf5_logging
TYPES:=$(wildcard types/*.h)
HEXARRS:=$(TYPES:%=%.hexarr)
HEXARRS += $(NAME).lua.hexarr
$(NAME).so: $(NAME).o $(INCLUDE_DIR)/libubx.so
${CC} $(CFLAGS_SHARED) -o $(NAME).so $(NAME).o $(INCLUDE_DIR)/libubx.so -lluajit-5.1 -lpthread
$(NAME).lua.hexarr: $(NAME).lua
../../tools/file2carr.lua $(NAME).lua
$(NAME).o: $(NAME).c $(INCLUDE_DIR)/ubx.h $(INCLUDE_DIR)/ubx_types.h $(INCLUDE_DIR)/ubx.c $(HEXARRS)
${CC} -fPIC -I$(INCLUDE_DIR) -c $(CFLAGS) $(NAME).c
$(NAME).c: ../logging/file_logger.c
echo "$$(cat ../../src/ubx.c | sed -n 1,31p)\n" | cat - ../logging/file_logger.c | sed -e 's/file_logger/$(NAME)/g' -e 's/logging/$(DIRNAME)/g' -e 's/writes to a/& $(NAME)/' -e 's/BSD-3-Clause/& LGPL-2.1+/' > $@
clean:
rm -f *.o *.so *.c *~ core $(HEXARRS)