Mercurial > sos > sos
changeset 19:d24d69066fc0
added C++ build support
author | Josef 'Jeff' Sipek <jeffpc@josefsipek.net> |
---|---|
date | Sun, 13 Mar 2011 21:10:35 -0400 |
parents | d3c54eb7510b |
children | def4b04c99f9 039a93c48889 |
files | Makefile include/system.h |
diffstat | 2 files changed, 14 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/Makefile Thu Mar 10 15:47:37 2011 -0500 +++ b/Makefile Sun Mar 13 21:10:35 2011 -0400 @@ -1,11 +1,13 @@ CROSS_COMPILE=s390x-linux- AS=$(CROSS_COMPILE)as CC=$(CROSS_COMPILE)gcc +CXX=$(CROSS_COMPILE)g++ LD=$(CROSS_COMPILE)ld OBJCOPY=$(CROSS_COMPILE)objcopy MAKEFLAGS += -rR --no-print-directory CFLAGS=-g -fno-strict-aliasing -fno-builtin -nostdinc -nostdlib -Wall -m64 -I include/ -O2 +CXXFLAGS=$(CFLAGS) LDFLAGS=-m elf64_s390 BINS=sarpn @@ -35,6 +37,9 @@ %.o: %.c $(CC) $(CFLAGS) -include include/system.h -c -o $@ $< +%.o: %.cpp + $(CXX) $(CXXFLAGS) -include include/system.h -c -o $@ $< + # # IPL specific bits #
--- a/include/system.h Thu Mar 10 15:47:37 2011 -0500 +++ b/include/system.h Sun Mar 13 21:10:35 2011 -0400 @@ -15,7 +15,14 @@ typedef unsigned char u8; typedef signed char s8; -extern int putline(char *buf, int len); -extern int getline(char *buf, int len); +#ifdef __cplusplus +extern "C" { +#endif + extern int putline(char *buf, int len); + extern int getline(char *buf, int len); + +#ifdef __cplusplus +} +#endif #endif