#
# ospmd makefile
#
INC_OSPMD= ../inc
VPATH=$(INC_OSPMD)

# Uncomment the last part to enable debug messages
CXXFLAGS= -pipe -Wall -g -I$(INC_OSPMD) -DOSPMD_DEBUG

# list of object files
OBJS=   ospmd.o \
	acpi_interface.o \
	apm_interface.o \
	client.o \
	pwrscheme.o \
	policy_button.o \
	policy_battery.o \
	policy_misc.o \
	properties.o


GLOBAL_DEPS= power.h ospmd.h power_private.h properties.h

all: ospmd

# Describe what components go into the ospmd daemon.
# Cannot use implicit rule since then C++ linker would not be used
ospmd: $(OBJS)
	$(CXX) $(OBJS) -o $@

# define header dependencies
ospmd.o alarm.o client.o pwrscheme.o policy_button.o policy_battery.o \
policy_misc.o properties.o: $(GLOBAL_DEPS)

apm_interface.o : apm_interface.h $(GLOBAL_DEPS)

acpi_interface.o : acpi_interface.h $(GLOBAL_DEPS)

clean:
	rm -f ospmd $(OBJS)

#define the rule for generating .o files from .cpp
%.o : %.cpp
	$(CXX) -c $(CPPFLAGS) $(CXXFLAGS) $< -o $@
