-
Notifications
You must be signed in to change notification settings - Fork 7
/
Makefile.am
52 lines (38 loc) · 1.16 KB
/
Makefile.am
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
43
44
45
46
47
48
49
50
51
52
AUTOMAKE_OPTIONS = subdir-objects
ACLOCAL_AMFLAGS = -I macros
CLEANFILES = *.a *.h *.o *.so *.slo *.lo *.la *.h *.dylib
if LINUX
SHARED_EXT=so
endif
if OSX
SHARED_EXT=dylib
endif
all: coraza/coraza.h libcoraza.a libcoraza.$(SHARED_EXT)
coraza/coraza.h: libcoraza/coraza.go libcoraza/log.go
@mkdir -p coraza
go tool cgo -exportheader $@ $^
libcoraza.a: libcoraza/coraza.go libcoraza/log.go
go build -buildmode=c-archive -o $@ $^
libcoraza.$(SHARED_EXT): libcoraza/coraza.go libcoraza/log.go
go build -buildmode=c-shared -o $@ $^
install-data-local: all check
@INSTALL@ -d $(DESTDIR)@prefix@/lib
@INSTALL@ -d $(DESTDIR)@prefix@/include/coraza
@INSTALL@ libcoraza.a $(DESTDIR)@prefix@/lib/
@INSTALL@ libcoraza.$(SHARED_EXT) $(DESTDIR)@prefix@/lib/
@INSTALL@ coraza/coraza.h $(DESTDIR)@prefix@/include/coraza/coraza.h
.PHONY: docs
docs:
# build C header doxygen
@doxygen ./Doxyfile
check_PROGRAMS = tests/simple_get
if OSX
AM_LDFLAGS = -framework CoreFoundation -framework Security
endif
if LINUX
AM_LDFLAGS = -fPIC -m64 -pthread -fno-common
endif
tests_simple_get_LDFLAGS = $(AM_LDFLAGS)
tests_simple_get_LDADD = ./libcoraza.a
check: tests/simple_get
./tests/simple_get