forked from avih/miniweb
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile.sub
69 lines (57 loc) · 1.12 KB
/
Makefile.sub
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
66
67
68
69
CFLAGS=-O2
HTTPOBJ = httppil.o http.o httpxml.o httphandler.o
HEADERS = httpint.h httpapi.h httpxml.h
ifndef TARGET
TARGET = miniweb
endif
ifndef NOPOST
HTTPOBJ+= httppost.o
DEFINES+= -DHTTPPOST
endif
ifdef AUTH
HTTPOBJ+= httpauth.o
DEFINES+= -DHTTPAUTH
endif
ifndef THREAD
DEFINES+= -DNOTHREAD
endif
ifndef DEBUG
DFLAGS += -s
else
DEFINES+= -D_DEBUG
LLDFLAGS += -g
endif
ifdef MPD
DEFINES+= -D_MPD
HTTPOBJ+= mpd.o procpil.o
endif
ifdef VOD
DEFINES+= -D_VOD
HTTPOBJ+= httpvod.o crc32.o
endif
ifdef WINDIR
DEFINES= -DWIN32
LDFLAGS += -lws2_32
OS="Win32"
else
#CFLAGS+= -fPIC
ifdef THREAD
LDFLAGS += -lpthread
endif
OS="Linux"
endif
all: $(HTTPOBJ) miniweb.o
@echo Building for $(OS)
$(CC) $(LDFLAGS) $(HTTPOBJ) miniweb.o -o $(TARGET)
min: $(HTTPOBJ) httpmin.o
@echo Building for $(OS)
$(CC) $(LDFLAGS) $(HTTPOBJ) httpmin.o -o httpd
%.o: %.c $(HEADERS)
$(CC) -c -o $@ $(CFLAGS) $(filter %.c, $^) $(DEFINES)
install: all
@rm -f /usr/bin/$(TARGET)
@cp $(TARGET) /usr/bin
clean:
@rm -f $(TARGET) $(TARGET).exe
@rm -f *.o *.ilk *.suo *.ncb
@rm -rf Debug Release