build: add common.mk
[openocd.git] / src / helper / Makefile.am
1 include $(top_srcdir)/common.mk
2
3 METASOURCES = AUTO
4 noinst_LTLIBRARIES = libhelper.la
5
6 if ECOSBOARD
7 CONFIGFILES = time_support_ecos.c
8 else
9 CONFIGFILES = options.c time_support_common.c
10 endif
11
12
13
14 libhelper_la_SOURCES = \
15         binarybuffer.c \
16         $(CONFIGFILES) \
17         configuration.c \
18         log.c \
19         command.c \
20         time_support.c \
21         replacements.c \
22         fileio.c \
23         util.c
24
25 if IOUTIL
26 libhelper_la_SOURCES += ioutil.c
27 else
28 libhelper_la_SOURCES += ioutil_stubs.c
29 endif
30
31 libhelper_la_CFLAGS =
32 if IS_MINGW
33 # FD_* macros are sloppy with their signs on MinGW32 platform
34 libhelper_la_CFLAGS += -Wno-sign-compare
35 endif
36
37 noinst_HEADERS = \
38         binarybuffer.h \
39         configuration.h \
40         ioutil.h \
41         util.h \
42         types.h \
43         log.h \
44         command.h \
45         time_support.h \
46         replacements.h \
47         fileio.h \
48         system.h \
49         bin2char.c
50
51 EXTRA_DIST = startup.tcl
52
53 BIN2C = bin2char$(EXEEXT_FOR_BUILD)
54
55 BUILT_SOURCES = $(BIN2C)
56
57 $(BIN2C): bin2char.c
58         ${CC_FOR_BUILD} ${CFLAGS_FOR_BUILD} $(srcdir)/bin2char.c -o $@
59
60 CLEANFILES = bin2char$(EXEEXT_FOR_BUILD)
61
62 MAINTAINERCLEANFILES = $(srcdir)/Makefile.in