-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
executable file
·68 lines (56 loc) · 1.09 KB
/
Makefile
File metadata and controls
executable file
·68 lines (56 loc) · 1.09 KB
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
CC?=gcc
CFLAGS?=-O2 -m32 #-march=pentium2 -fomit-frame-pointer
LDFLAGS?=-m32
HTTPOBJ = httppil.o http.o
HEADERS = httpint.h httpapi.h
ifndef TARGET
TARGET = miniweb
endif
ifdef POST
HTTPOBJ+= httppost.o
DEFINES+= -DHTTPPOST
endif
ifdef AUTH
HTTPOBJ+= httpauth.o
DEFINES+= -DHTTPAUTH
endif
ifndef THREAD
DEFINES+= -DNOTHREAD
endif
ifndef DEBUG
DEFINES+= -DNODEBUG
endif
ifdef MPD
DEFINES+= -D_MPD
HTTPOBJ+= mpd.o
endif
ifdef VOD
DEFINES+= -D_VOD
HTTPOBJ+= vod.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