Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit e1bb33a

Browse files
committed
Updated makefile for c++14, changed to unix lineendings, use prodflags by default
1 parent 08cd165 commit e1bb33a

File tree

1 file changed

+42
-43
lines changed

1 file changed

+42
-43
lines changed

Makefile

Lines changed: 42 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,42 @@
1-
# Makefile for httpserver
2-
# (C) Ramsey Kant 2011-2012
3-
4-
CC := g++
5-
SRCDIR := src
6-
BINDIR := bin
7-
BUILDDIR := build
8-
TARGET := httpserver
9-
UNAME := $(shell uname)
10-
11-
# Debug Flags
12-
DEBUGFLAGS := -g3 -O0 -Wall
13-
RTCHECKS := -fmudflap -fstack-check -gnato
14-
15-
# Production Flags
16-
PRODFLAGS := -Wall -O2
17-
18-
ifeq ($(UNAME), Linux)
19-
# Linux Flags
20-
CFLAGS := -std=c++11 -Iinclude/ $(DEBUGFLAGS)
21-
LINK := -lpthread -lkqueue $(DEBUGFLAGS)
22-
else
23-
# OSX / BSD Flags
24-
CFLAGS := -std=c++11 -stdlib=libc++ -Iinclude/ $(DEBUGFLAGS)
25-
LINK := -stdlib=libc++ $(DEBUGFLAGS)
26-
endif
27-
28-
29-
SRCEXT := cpp
30-
SOURCES := $(shell find $(SRCDIR) -type f -name *.$(SRCEXT))
31-
OBJECTS := $(patsubst $(SRCDIR)/%,$(BUILDDIR)/%,$(SOURCES:.$(SRCEXT)=.o))
32-
33-
$(TARGET): $(OBJECTS)
34-
@echo " Linking..."; $(CC) $(LINK) $^ -o $(BINDIR)/$(TARGET)
35-
36-
$(BUILDDIR)/%.o: $(SRCDIR)/%.$(SRCEXT)
37-
@mkdir -p $(BUILDDIR)
38-
@echo " CC $<"; $(CC) $(CFLAGS) -c -o $@ $<
39-
40-
clean:
41-
@echo " Cleaning..."; rm -r $(BUILDDIR) $(BINDIR)/$(TARGET)*
42-
43-
.PHONY: clean
1+
# Makefile for httpserver
2+
# (C) Ramsey Kant 2011-2012
3+
4+
CC := g++
5+
SRCDIR := src
6+
BINDIR := bin
7+
BUILDDIR := build
8+
TARGET := httpserver
9+
UNAME := $(shell uname)
10+
11+
# Debug Flags
12+
DEBUGFLAGS := -g3 -O0 -Wall -fmudflap
13+
14+
# Production Flags
15+
PRODFLAGS := -Wall -O2 -fstack-check -fstack-protector-all
16+
17+
ifeq ($(UNAME), Linux)
18+
# Linux Flags
19+
CFLAGS := -std=c++14 -Iinclude/ $(PRODFLAGS)
20+
LINK := -lpthread -lkqueue $(PRODFLAGS)
21+
else
22+
# OSX / BSD Flags
23+
CFLAGS := -std=c++14 -stdlib=libc++ -Iinclude/ $(PRODFLAGS)
24+
LINK := -stdlib=libc++ $(PRODFLAGS)
25+
endif
26+
27+
28+
SRCEXT := cpp
29+
SOURCES := $(shell find $(SRCDIR) -type f -name *.$(SRCEXT))
30+
OBJECTS := $(patsubst $(SRCDIR)/%,$(BUILDDIR)/%,$(SOURCES:.$(SRCEXT)=.o))
31+
32+
$(TARGET): $(OBJECTS)
33+
@echo " Linking..."; $(CC) $(LINK) $^ -o $(BINDIR)/$(TARGET)
34+
35+
$(BUILDDIR)/%.o: $(SRCDIR)/%.$(SRCEXT)
36+
@mkdir -p $(BUILDDIR)
37+
@echo " CC $<"; $(CC) $(CFLAGS) -c -o $@ $<
38+
39+
clean:
40+
@echo " Cleaning..."; rm -r $(BUILDDIR) $(BINDIR)/$(TARGET)*
41+
42+
.PHONY: clean

0 commit comments

Comments
 (0)