File: Makefile

package info (click to toggle)
yaws 1.88-2%2Bsqueeze1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 5,544 kB
  • ctags: 5,440
  • sloc: erlang: 27,321; sh: 3,823; ansic: 1,264; makefile: 874; lisp: 79; xml: 12; python: 3
file content (65 lines) | stat: -rw-r--r-- 1,659 bytes parent folder | download
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
53
54
55
56
57
58
59
60
61
62
63
64
65
include ../include.mk


# don't c-compile anything on win32 (yet)
# I don't know how to make a linked in driver using gcc, or any
# other compiler there, and have no intentions of finding out

ifdef WIN32
	PRIV_FILES=../priv/.foo
else
# don't make pam if configured out with --disable-pam
	PRIV_FILES= ../priv/lib/setuid_drv.$(DLL)  $(EPAM)
endif

ifeq ($(HAVE_SENDFILE),true)
	PRIV_FILES += ../priv/lib/yaws_sendfile_drv.$(DLL)
endif


CFLAGS += -I"${ERLDIR}/usr/include"

# and for MacOs + possibly others ...
CFLAGS += -I/usr/include/pam/ $(EXTRAINCLUDE)

#
# Targets
#

all: $(PRIV_FILES) 
debug: 
	CFLAGS="$(CFLAGS) -g" $(MAKE) all

clean:
	-rm -f $(PRIV_FILES) setuid_drv.$(OBJ) epam.$(OBJ) yaws_sendfile_drv.$(OBJ) hashtable.$(OBJ)

install:	$(PRIV_FILES)
	$(INSTALL) -d $(DESTDIR)$(PREFIX)/lib/yaws/priv/lib
	$(INSTALL) $(PRIV_FILES) $(DESTDIR)$(PREFIX)/lib/yaws/priv/lib
ifndef WIN32
	if [ `id -u` = "0" -a -d $(DESTDIR)$(PREFIX)/lib/yaws/priv/epam ]; then \
		chown root $(DESTDIR)$(PREFIX)/lib/yaws/priv/epam; \
		chmod a+s $(DESTDIR)$(PREFIX)/lib/yaws/priv/epam; \
	fi
endif


../priv/lib/setuid_drv.$(DLL): setuid_drv.$(OBJ)
	$(LD_SHARED) $(OUT) $@ $< $(DLL_LIBS)
setuid_drv.$(OBJ):	setuid_drv.c
	$(CC) -c $(FPIC) $(CFLAGS) -DDYNAMIC_DRIVER $<

../priv/lib/yaws_sendfile_drv.$(DLL): yaws_sendfile_drv.$(OBJ) hashtable.$(OBJ)
	$(LD_SHARED) $(OUT) $@ $^ $(DLL_LIBS)
yaws_sendfile_drv.$(OBJ):	yaws_sendfile_drv.c
	$(CC) -c $(FPIC) $(CFLAGS) -DDYNAMIC_DRIVER $<
hashtable.$(OBJ):	hashtable.c
	$(CC) -c $(FPIC) $(CFLAGS) $<

../priv/.foo:
	touch $@

epam.$(OBJ):	epam.c
	$(CC) -c $(CFLAGS) $<
../priv/epam: epam.$(OBJ)
	$(CC) -o $@ $(CFLAGS) $< -lpam