]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - android-sdk/arm-ds5-gator.git/blob - daemon/common.mk
gator-driver: Handle task struct correctly
[android-sdk/arm-ds5-gator.git] / daemon / common.mk
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++
10 ifeq ($(WERROR),1)
11         CFLAGS += -Werror
12 endif
13 # -s strips the binary of debug info
14 LDFLAGS += -s
15 TARGET = gatord
16 C_SRC = $(wildcard mxml/*.c) $(wildcard libsensors/*.c)
17 CPP_SRC = $(wildcard *.cpp)
19 all: $(TARGET)
21 events.xml: events_header.xml $(wildcard events-*.xml) events_footer.xml
22         cat $^ > $@
24 include $(wildcard *.d)
25 include $(wildcard mxml/*.d)
27 EventsXML.cpp: events_xml.h
28 ConfigurationXML.cpp: configuration_xml.h
30 # Don't regenerate conf-lex.c or conf-parse.c
31 libsensors/conf-lex.c: ;
32 libsensors/conf-parse.c: ;
34 %_xml.h: %.xml escape
35         ./escape $< > $@
37 %.o: %.c
38         $(GCC) -c $(CFLAGS) -o $@ $<
40 %.o: %.cpp
41         $(CPP) -c $(CFLAGS) $(CXXFLAGS) -o $@ $<
43 $(TARGET): $(CPP_SRC:%.cpp=%.o) $(C_SRC:%.c=%.o)
44         $(CPP) $(LDFLAGS) -o $@ $^ -lrt -pthread
46 escape: escape.c
47         gcc $^ -o $@
49 clean:
50         rm -f *.d *.o mxml/*.d mxml/*.o libsensors/*.d libsensors/*.o $(TARGET) escape events.xml events_xml.h configuration_xml.h