mirror of
https://github.com/cesanta/mongoose.git
synced 2025-06-26 22:50:39 +08:00
Styling changes plus extra GCC options to suppress certain warnings
This commit is contained in:
parent
3d3359910f
commit
001cd78b45
31
Makefile
31
Makefile
@ -22,11 +22,13 @@ all:
|
|||||||
### UNIX build: linux, bsd, mac, rtems
|
### UNIX build: linux, bsd, mac, rtems
|
||||||
##########################################################################
|
##########################################################################
|
||||||
|
|
||||||
CFLAGS = -W -Wall -std=c99 -pedantic -O2 $(COPT)
|
GCC_WARNS = -W -Wall -pedantic -Wno-missing-field-initializers \
|
||||||
|
-Wno-unused-parameter -Wno-format-zero-length -Wno-missing-braces
|
||||||
|
CFLAGS = -W -Wall -std=c99 -O2 $(GCC_WARNS) $(COPT)
|
||||||
MAC_SHARED = -flat_namespace -bundle -undefined suppress
|
MAC_SHARED = -flat_namespace -bundle -undefined suppress
|
||||||
LINFLAGS = -ldl -pthread $(CFLAGS)
|
LINFLAGS = -ldl -pthread $(CFLAGS)
|
||||||
LIB = _$(PROG).so
|
LIB = _$(PROG).so
|
||||||
#CC = g++
|
CC = gcc
|
||||||
|
|
||||||
# Make sure that the compiler flags come last in the compilation string.
|
# Make sure that the compiler flags come last in the compilation string.
|
||||||
# If not so, this can break some on some Linux distros which use
|
# If not so, this can break some on some Linux distros which use
|
||||||
@ -45,9 +47,9 @@ mac:
|
|||||||
$(CC) mongoose.c main.c -pthread -o $(PROG) $(CFLAGS)
|
$(CC) mongoose.c main.c -pthread -o $(PROG) $(CFLAGS)
|
||||||
|
|
||||||
solaris:
|
solaris:
|
||||||
gcc mongoose.c -pthread -lnsl \
|
$(CC) mongoose.c -pthread -lnsl \
|
||||||
-lsocket -fpic -fPIC -shared -o $(LIB) $(CFLAGS)
|
-lsocket -fpic -fPIC -shared -o $(LIB) $(CFLAGS)
|
||||||
gcc mongoose.c main.c -pthread -lnsl -lsocket -o $(PROG) $(CFLAGS)
|
$(CC) mongoose.c main.c -pthread -lnsl -lsocket -o $(PROG) $(CFLAGS)
|
||||||
|
|
||||||
|
|
||||||
##########################################################################
|
##########################################################################
|
||||||
@ -107,20 +109,20 @@ cyassl:
|
|||||||
|
|
||||||
windows:
|
windows:
|
||||||
rc win32\res.rc
|
rc win32\res.rc
|
||||||
$(CL) main.c mongoose.c /GA $(LINK) win32\res.res \
|
$(CL) /I win32 main.c mongoose.c /GA $(LINK) win32\res.res \
|
||||||
$(GUILIB) /out:$(PROG).exe
|
$(GUILIB) /out:$(PROG).exe
|
||||||
$(CL) mongoose.c /GD $(LINK) /DLL /DEF:win32\dll.def /out:_$(PROG).dll
|
$(CL) mongoose.c /GD $(LINK) /DLL /DEF:win32\dll.def /out:_$(PROG).dll
|
||||||
|
|
||||||
# Build for Windows under MinGW
|
# Build for Windows under MinGW
|
||||||
#MINGWDBG= -DDEBUG -O0
|
#MINGWDBG= -DDEBUG -O0 -ggdb
|
||||||
MINGWDBG= -DNDEBUG -Os
|
MINGWDBG= -DNDEBUG -Os
|
||||||
#MINGWOPT= -W -Wall -mthreads -Wl,--subsystem,console $(MINGWDBG) -DHAVE_STDINT
|
MINGWOPT= -std=c99 -mthreads -Wl,--subsystem,console $(MINGWDBG) -DHAVE_STDINT $(GCC_WARNINGS) $(COPT)
|
||||||
MINGWOPT= -W -Wall -mthreads -Wl,--subsystem,windows $(MINGWDBG)
|
#MINGWOPT= -std=c99 -mthreads -Wl,--subsystem,windows $(MINGWDBG) -DHAVE_STDINT $(GCC_WARNINGS) $(COPT)
|
||||||
mingw:
|
mingw:
|
||||||
windres win32\res.rc win32\res.o
|
windres win32\res.rc win32\res.o
|
||||||
gcc $(MINGWOPT) mongoose.c -lws2_32 \
|
$(CC) $(MINGWOPT) mongoose.c -lws2_32 \
|
||||||
-shared -Wl,--out-implib=$(PROG).lib -o _$(PROG).dll
|
-shared -Wl,--out-implib=$(PROG).lib -o _$(PROG).dll
|
||||||
gcc $(MINGWOPT) mongoose.c main.c win32\res.o -lws2_32 -ladvapi32 \
|
$(CC) $(MINGWOPT) -Iwin32 mongoose.c main.c win32\res.o -lws2_32 -ladvapi32 \
|
||||||
-o $(PROG).exe
|
-o $(PROG).exe
|
||||||
|
|
||||||
|
|
||||||
@ -135,12 +137,15 @@ man:
|
|||||||
# "TEST=unit make test" - perform unit test only
|
# "TEST=unit make test" - perform unit test only
|
||||||
# "TEST=embedded" - test embedded API by building and testing test/embed.c
|
# "TEST=embedded" - test embedded API by building and testing test/embed.c
|
||||||
# "TEST=basic_tests" - perform basic tests only (no CGI, SSI..)
|
# "TEST=basic_tests" - perform basic tests only (no CGI, SSI..)
|
||||||
test: do_test
|
tests:
|
||||||
do_test:
|
|
||||||
perl test/test.pl $(TEST)
|
perl test/test.pl $(TEST)
|
||||||
|
|
||||||
release: clean
|
release: clean
|
||||||
F=mongoose-`perl -lne '/define\s+MONGOOSE_VERSION\s+"(\S+)"/ and print $$1' mongoose.c`.tgz ; cd .. && tar -czf x mongoose/{LICENSE,Makefile,bindings,examples,test,win32,mongoose.c,mongoose.h,mongoose.1,main.c} && mv x mongoose/$$F
|
F=mongoose-`perl -lne '/define\s+MONGOOSE_VERSION\s+"(\S+)"/ and print $$1' mongoose.c`.tgz ; cd .. && tar -czf x mongoose/{LICENSE,Makefile,bindings,examples,test,win32,mongoose.c,mongoose.h,mongoose.1,main.c} && mv x mongoose/$$F
|
||||||
|
|
||||||
|
mongoose.c: mongoose.h
|
||||||
|
main.c: mongoose.h
|
||||||
|
.PHONY: mongoose.c main.c
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -rf *.o *.core $(PROG) *.obj *.so $(PROG).txt *.dSYM *.tgz
|
rm -rf *.o *.core $(PROG) *.obj *.so $(PROG).txt *.dSYM *.tgz $(PROG).exe *.dll *.lib
|
||||||
|
Loading…
Reference in New Issue
Block a user