2002-11-02 16:52:07 +01:00
|
|
|
MODULES := common eressea common/triggers common/items common/spells common/races common/attributes common/gamecode common/kernel common/util common/modules
|
2001-01-25 10:37:55 +01:00
|
|
|
|
2002-11-02 16:52:07 +01:00
|
|
|
CC = gcc
|
|
|
|
CFLAGS += -Wall -Wwrite-strings -Wstrict-prototypes \
|
|
|
|
-Werror-implicit-function-declaration \
|
|
|
|
-Wno-char-subscripts
|
2001-01-28 10:24:47 +01:00
|
|
|
|
2002-11-02 16:52:07 +01:00
|
|
|
# look for include files in
|
|
|
|
# each of the modules
|
|
|
|
CFLAGS += -I/cygwin/usr/include
|
|
|
|
CFLAGS += -I.
|
|
|
|
CFLAGS += $(patsubst %,-I%,$(MODULES))
|
|
|
|
# extra libraries if required
|
|
|
|
LIBS :=
|
|
|
|
# each module will add to this
|
|
|
|
SRC :=
|
2001-01-25 10:37:55 +01:00
|
|
|
|
2002-11-02 16:52:07 +01:00
|
|
|
# include the description for
|
|
|
|
# each module
|
|
|
|
include $(patsubst %,%/module.mk,$(MODULES))
|
|
|
|
# determine the object files
|
|
|
|
OBJ := $(patsubst %.c,%.o, $(filter %.c,$(SRC))) \
|
|
|
|
$(patsubst %.y,%.o, $(filter %.y,$(SRC)))
|
|
|
|
# link the program
|
|
|
|
eressea: $(OBJ)
|
|
|
|
$(CC) -o $@ $(OBJ) $(LIBS)
|
2001-01-25 10:37:55 +01:00
|
|
|
|
2002-11-02 16:52:07 +01:00
|
|
|
%.o: %.c
|
|
|
|
@echo Compiling $@
|
|
|
|
@$(CC) $(CFLAGS) -c -o $@ $<
|
|
|
|
|
|
|
|
# include the C include
|
|
|
|
# dependencies
|
|
|
|
include $(OBJ:.o=.d)
|
|
|
|
# calculate C include
|
|
|
|
# dependencies
|
|
|
|
%.d: %.c
|
|
|
|
gcc -MM -MG $(CFLAGS) $< > $@
|