summaryrefslogtreecommitdiff
path: root/src/plugins/Makefile.in
blob: 5c93edb84dc374148397db10a97312ec91fe24ed (plain) (blame)
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
# Copyright (c) Hercules Dev Team, licensed under GNU GPL.
# See the LICENSE file

# @configure_input@

################  PLUGIN CONFIGURATION  ##############################
#                                                                    #
# When you add a plugin, add its name here:                          #
# Example: if you have a plugin named my_cool_plugin.c and another   #
# one named my_second_plugin.c, add them to the list like this:      #
#                                                                    #
# MYPLUGINS = my_cool_plugin my_second_plugin                        #
#                                                                    #
# This is only needed if you want to build your plugin through       #
#   'make plugins' or 'make all'. If you don't add it to this list,  #
#   you will still be able to build your plugin through              #
#   'make plugin.my_plugin'                                          #
#                                                                    #
# Note: DO NOT include the .c extension!!!                           #

MYPLUGINS = 

#                                                                    #
#########  DO NOT EDIT ANYTHING BELOW THIS LINE!!!  ##################

# All plugins in the src/plugins directory
HPMHOOKING = $(addprefix HPMHooking_, login char map)
ALLPLUGINS = $(filter-out HPMHooking, $(basename $(wildcard *.c))) $(HPMHOOKING)

# Plugins that will be built through 'make plugins' or 'make all'
PLUGINS = sample db2sql HPMHooking_login HPMHooking_map $(MYPLUGINS)

COMMON_D = ../common
COMMON_H = $(wildcard $(COMMON_D)/*.h)

CONFIG_D = ../config
CONFIG_H = $(wildcard $(CONFIG_D)/*.h) $(wildcard $(CONFIG_D)/*/*.h)

MAP_H = $(wildcard ../map/*.h)
CHAR_H = $(wildcard ../char/*.h)
LOGIN_H = $(wildcard ../login/*.h)
ALL_H = $(COMMON_H) $(CONFIG_H) $(MAP_H) $(CHAR_H) $(LOGIN_H)

@SET_MAKE@

CC = @CC@
export CC

#####################################################################
.PHONY: all $(ALLPLUGINS) HPMHooking clean buildclean help

all: $(PLUGINS) Makefile

$(ALLPLUGINS): %: ../../plugins/%@DLLEXT@
	@echo "	PLUGIN	$@"

HPMHooking: $(HPMHOOKING)

buildclean:
	@echo "	CLEAN	plugins (build temp files)"
	@rm -rf *.o

clean: buildclean
	@echo "	CLEAN	plugins"
	@rm -rf ../../plugins/*@DLLEXT@

help:
	@echo "possible targets are $(PLUGINS:%='%') 'all' 'clean' 'help'"
	@echo ""
	@echo "$(PLUGINS:%='%')"
	@echo "              - builds a specific plugin"
	@echo "'all'         - builds all above targets"
	@echo "'clean'       - cleans builds and objects"
	@echo "'buildclean'  - cleans build temporary (object) files, without deleting the"
	@echo "                compiled plugins"
	@echo "'help'        - outputs this message"

#####################################################################

Makefile: Makefile.in
	@$(MAKE) -C ../.. src/plugins/Makefile

.SECONDEXPANSION:

../../plugins/%@DLLEXT@: %.c $(ALL_H) $$(shell ls %/* 2>/dev/null)
	@echo "	CC	$<"
	@$(CC) @PLUGINSTATIC@ @DEFS@ @CFLAGS@ @CPPFLAGS@ @LDFLAGS@ @SOFLAGS@ -o $@ $<

../../plugins/HPMHooking_login@DLLEXT@: HPMHOOKINGTYPE = LOGIN
../../plugins/HPMHooking_char@DLLEXT@: HPMHOOKINGTYPE = CHAR
../../plugins/HPMHooking_map@DLLEXT@: HPMHOOKINGTYPE = MAP

../../plugins/HPMHooking_%@DLLEXT@: HPMHooking.c $(ALL_H) $$(shell ls HPMHooking/*_%* HPMHooking/*_common* 2>/dev/null)
	@echo "	CC	$< ($(HPMHOOKINGTYPE))"
	@$(CC) -DHPMHOOKING_$(HPMHOOKINGTYPE) @PLUGINSTATIC@ @DEFS@ @CFLAGS@ @CPPFLAGS@ @LDFLAGS@ @SOFLAGS@ -o $@ $<