1 #
2 # Makefile for ARM Streamline - Gator Daemon
3 #
5 # Uncomment and define CROSS_COMPILE if it is not already defined
6 # CROSS_COMPILE=/path/to/cross-compiler/arm-none-linux-gnueabi-
7 ARCH=arm
9 CPP=$(CROSS_COMPILE)g++
10 GCC=$(CROSS_COMPILE)gcc
12 # -g produces debugging information
13 # -O3 maximum optimization
14 # -O0 no optimization, used for debugging
15 # -Wall enables most warnings
16 # -Werror treats warnings as errors
17 # -std=c++0x is the planned new c++ standard
18 # -std=c++98 is the 1998 c++ standard
19 # -march=armv5t is required to set the minimum architecture
20 # -mthumb-interwork is required for interworking to ARM or Thumb stdlibc
21 CFLAGS=-O3 -Wall -Werror -march=armv5t -mthumb-interwork
22 TARGET=gatord
23 C_SRC = $(wildcard mxml/*.c)
24 CPP_SRC = $(wildcard *.cpp)
25 TGT_OBJS = $(CPP_SRC:%.cpp=%.o) \
26 $(C_SRC:%.c=%.o)
28 all: $(TARGET)
30 %.o: %.c *.h
31 $(GCC) -c $(CFLAGS) -o $@ $<
33 %.o: %.cpp *.h
34 $(CPP) -c $(CFLAGS) -o $@ $<
36 $(TARGET): convert $(TGT_OBJS)
37 $(CPP) -s -o $@ $(TGT_OBJS) -lc -lrt -lpthread
38 rm events_xml.h configuration_xml.h
40 convert:
41 cat events_header.xml events-*\.xml events_footer.xml > events.xml
42 xxd -i events.xml > events_xml.h
43 xxd -i configuration.xml > configuration_xml.h
45 clean:
46 rm -f *.o mxml/*.o $(TARGET) events.xml events_xml.h configuration_xml.h