summaryrefslogtreecommitdiff
path: root/src/plugins/Makefile.in
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/Makefile.in')
-rw-r--r--src/plugins/Makefile.in77
1 files changed, 65 insertions, 12 deletions
diff --git a/src/plugins/Makefile.in b/src/plugins/Makefile.in
index 3c80fa0e1..77040d567 100644
--- a/src/plugins/Makefile.in
+++ b/src/plugins/Makefile.in
@@ -1,30 +1,83 @@
+# Copyright (c) Hercules Dev Team, licensed under GNU GPL.
+# See the LICENSE file
-COMMON_H = ../common/HPMi.h ../common/cbasetypes.h
+# @configure_input@
-PLUGINS = sample db2sql
+################ 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
+ALLPLUGINS = $(basename $(wildcard *.c))
+
+# Plugins that will be built through 'make plugins' or 'make all'
+PLUGINS = sample db2sql HPMHooking $(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 $(PLUGINS) sample db2sql clean help
+.PHONY: all $(ALLPLUGINS) clean buildclean help
-all: $(PLUGINS)
+all: $(PLUGINS) Makefile
-sample: sample@DLLEXT@
+$(ALLPLUGINS): %: ../../plugins/%@DLLEXT@
-db2sql: db2sql@DLLEXT@
+buildclean:
+ @echo " CLEAN plugins (build temp files)"
+ @rm -rf *.o
-clean:
+clean: buildclean
@echo " CLEAN plugins"
- @rm -rf *.o
+ @rm -rf ../../plugins/*@DLLEXT@
help:
@echo "possible targets are $(PLUGINS:%='%') 'all' 'clean' 'help'"
- @echo "'sample' - sample plugin"
- @echo "'help' - outputs this message"
+ @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"
#####################################################################
-%@DLLEXT@: %.c $(COMMON_H)
+Makefile: Makefile.in
+ @$(MAKE) -C ../.. src/plugins/Makefile
+
+.SECONDEXPANSION:
+
+../../plugins/%@DLLEXT@: %.c $(ALL_H) $$(shell ls %/* 2>/dev/null)
@echo " CC $<"
- @@CC@ @DEFS@ @CFLAGS@ @CPPFLAGS@ @LDFLAGS@ @SOFLAGS@ -o ../../plugins/$@ $< \ No newline at end of file
+ @$(CC) @DEFS@ @CFLAGS@ @CPPFLAGS@ @LDFLAGS@ @SOFLAGS@ -o $@ $<