1
0
Fork 0
mirror of https://github.com/hermitcore/libhermit.git synced 2025-03-09 00:00:03 +01:00

add Go example to the makefile

This commit is contained in:
Stefan Lankes 2016-09-10 10:13:23 +02:00
parent ab2d9cf6ae
commit ab3ef11869
2 changed files with 16 additions and 3 deletions

1
hermit/.gitignore vendored
View file

@ -16,6 +16,7 @@ usr/tests/hello++
usr/tests/hellof
usr/tests/jacobi
usr/tests/thr_hello
usr/tests/pi
usr/tests/RCCE_minimum
usr/tests/signals
usr/benchmarks/RCCE_pingping

View file

@ -8,6 +8,7 @@ KEEP_DEBUG = --only-keep-debug
CROSSCOMPREFIX = x86_64-hermit-
CC_FOR_TARGET = $(CROSSCOMPREFIX)gcc
GO_FOR_TARGET = $(CROSSCOMPREFIX)gccgo
CXX_FOR_TARGET = $(CROSSCOMPREFIX)g++
GCC_FOR_TARGET = $(CROSSCOMPREFIX)gcc
CPP_FOR_TARGET = $(CROSSCOMPREFIX)cpp
@ -34,6 +35,10 @@ endif
@echo [CC] $@
$Q$(CC_FOR_TARGET) -c $(CFLAGS_FOR_TARGET) -o $@ $<
%.o : %.go
@echo [GO] $@
$Q$(GO_FOR_TARGET) -c $(GOFLAGS_FOR_TARGET) -o $@ $<
%.o: %.cpp
@echo [CXX] $@
$Q$(CXX_FOR_TARGET) -c $(CXXFLAGS_FOR_TARGET) -o $@ $<
@ -44,7 +49,7 @@ endif
default: all
all: hello hello++ thr_hello jacobi hellof RCCE_minimum signals
all: hello hello++ thr_hello jacobi hellof RCCE_minimum signals pi
hello++: hello++.o
@echo [LD] $@
@ -67,6 +72,13 @@ hellof: hellof.o
$Q$(OBJCOPY_FOR_TARGET) $(STRIP_DEBUG) $@
$Qchmod a-x $@.sym
pi: pi.o
@echo [LD] $@
$Q$(GO_FOR_TARGET) -pthread -o $@ $< $(LDFLAGS_FOR_TARGET) $(GOFLAGS_FOR_TARGET)
$Q$(OBJCOPY_FOR_TARGET) $(KEEP_DEBUG) $@ $@.sym
$Q$(OBJCOPY_FOR_TARGET) $(STRIP_DEBUG) $@
$Qchmod a-x $@.sym
jacobi: jacobi.o
@echo [LD] $@
$Q$(CC_FOR_TARGET) -o $@ $< $(LDFLAGS_FOR_TARGET) $(CFLAGS_FOR_TARGET)
@ -105,11 +117,11 @@ RCCE_minimum: RCCE_minimum.o
clean:
@echo Cleaning tests
$Q$(RM) hello hello++ hellof jacobi thr_hello RCCE_minimum signals *.sym *.o *~
$Q$(RM) hello hello++ hellof jacobi thr_hello RCCE_minimum signals pi *.sym *.o *~
veryclean:
@echo Propper cleaning tests
$Q$(RM) hello hello++ hellof jacobi thr_hello RCCE_minimum *.sym *.o *~
$Q$(RM) hello hello++ hellof jacobi thr_hello RCCE_minimum pi *.sym *.o *~
depend:
$Q$(CC_FOR_TARGET) -MM $(CFLAGS_FOR_TARGET) *.c > Makefile.dep