3 # Written by: Test_User <hax@andrewyu.org>
5 # This is free and unencumbered software released into the public
8 # Anyone is free to copy, modify, publish, use, compile, sell, or
9 # distribute this software, either in source code form or as a compiled
10 # binary, for any purpose, commercial or non-commercial, and by any
13 # In jurisdictions that recognize copyright laws, the author or authors
14 # of this software dedicate any and all copyright interest in the
15 # software to the public domain. We make this dedication for the benefit
16 # of the public at large and to the detriment of our heirs and
17 # successors. We intend this dedication to be an overt act of
18 # relinquishment in perpetuity of all present and future rights to this
19 # software under copyright law.
21 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
22 # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
23 # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
24 # IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
25 # OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
26 # ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
27 # OTHER DEALINGS IN THE SOFTWARE.
31 CFLAGS
+= $(INCLUDEFLAGS
) -D_REENTRANT
-ggdb3
-Wall
-Wextra
-Wsign-conversion
-Wno-unused-parameter
$(shell pkg-config gnutls
--cflags) -std
=gnu99
33 LDFLAGS
= -lpthread
$(shell pkg-config gnutls
--libs
)
36 @printf
'%s\n' 'LAST_VERBOSE = 1' > .makeopts
37 @printf
'%s\n' 'LAST_COLORIZE = 1' >> .makeopts
38 @printf
'%s\n' 'LAST_SAFE_STACK = 0' >> .makeopts
46 ifneq ($(VERBOSE
),$(LAST_VERBOSE
))
50 VERBOSE
= $(LAST_VERBOSE
)
54 ifneq ($(COLORIZE
),$(LAST_COLORIZE
))
58 COLORIZE
= $(LAST_COLORIZE
)
61 ifneq ($(SAFE_STACK
),)
62 ifneq ($(SAFE_STACK
),$(LAST_SAFE_STACK
))
66 SAFE_STACK
= $(LAST_SAFE_STACK
)
70 $(shell printf
'%s%s\n' 'LAST_VERBOSE = ' $(VERBOSE
) > .makeopts
)
71 $(shell printf
'%s%s\n' 'LAST_COLORIZE = ' $(COLORIZE
) >> .makeopts
)
72 $(shell printf
'%s%s\n' 'LAST_SAFE_STACK = ' $(SAFE_STACK
) >> .makeopts
)
74 $(shell $(RM
) haxserv
*.o
)
77 DEPS
= $(shell $(CC
) $(INCLUDEFLAGS
) -MM
-MT
$(1).o
$(1).c | sed
's_\\$$__g')
84 CFLAGS
+= -DCOLORIZE
=1
87 ifeq ($(SAFE_STACK
), 1)
88 CFLAGS
+= -fstack-check
94 haxserv
: main.o server_network.o client_network.o general_network.o commands.o table.o config.o tls.o utils.o
95 $(CC
) $^
-o
$@
$(LDFLAGS
)
98 $(CC
) $(CFLAGS
) -c
$< -o
$@
102 $(call DEPS
,server_network
)
104 $(call DEPS
,client_network
)
106 $(call DEPS
,general_network
)
108 $(call DEPS
,commands
)