1 # -g produces debugging information
2 # -O3 maximum optimization
3 # -O0 no optimization, used for debugging
4 # -Wall enables most warnings
5 # -Werror treats warnings as errors
6 # -std=c++0x is the planned new c++ standard
7 # -std=c++98 is the 1998 c++ standard
8 CFLAGS += -O3 -Wall -fno-exceptions -pthread -MMD -DETCDIR=\"/etc\" -Ilibsensors
9 CXXFLAGS += -fno-rtti -Wextra # -Weffc++
13 # -s strips the binary of debug info
16 C_SRC = $(wildcard mxml/*.c) $(wildcard libsensors/*.c)
17 CPP_SRC = $(wildcard *.cpp)
21 events.xml: events_header.xml $(wildcard events-*.xml) events_footer.xml
24 include $(wildcard *.d)
25 include $(wildcard mxml/*.d)
27 EventsXML.cpp: events_xml.h
28 ConfigurationXML.cpp: defaults_xml.h
30 # Don't regenerate conf-lex.c or conf-parse.c
31 libsensors/conf-lex.c: ;
32 libsensors/conf-parse.c: ;
38 $(GCC) -c $(CFLAGS) -o $@ $<
41 $(CPP) -c $(CFLAGS) $(CXXFLAGS) -o $@ $<
43 $(TARGET): $(CPP_SRC:%.cpp=%.o) $(C_SRC:%.c=%.o)
44 $(CPP) $(LDFLAGS) -o $@ $^ -lrt -pthread
50 rm -f *.d *.o mxml/*.d mxml/*.o libsensors/*.d libsensors/*.o $(TARGET) escape events.xml events_xml.h defaults_xml.h