github.com/notti/go-dynamic@v0.0.0-20190619201224-fc443047424c/example/Makefile (about)

     1  platform_id = $$( uname -s )
     2  GO_GCFLAGS = $$( \
     3      case $(platform_id) in \
     4          (FreeBSD) echo -gcflags=github.com/notti/nocgo/fakecgo=-std ;; \
     5      esac )
     6  
     7  all: main32 main32C main64 main64C testlib
     8  
     9  testlib: 
    10  	$(MAKE) -C testlib
    11  
    12  main32: main.go testlib
    13  	rm -f main32
    14  	-CGO_ENABLED=0 GOARCH=386 go build $(GO_GCFLAGS) -o main32 main.go && LD_LIBRARY_PATH=testlib ./main32 a b c
    15  	
    16  main32C: main.go testlib
    17  	rm -f main32C
    18  	-CGO_ENABLED=1 GOARCH=386 go build $(GO_GCFLAGS) -o main32C main.go && LD_LIBRARY_PATH=testlib ./main32C a b c
    19  
    20  main64: main.go testlib
    21  	rm -f main64
    22  	-CGO_ENABLED=0 go build $(GO_GCFLAGS) -o main64 main.go && LD_LIBRARY_PATH=testlib ./main64 a b c
    23  
    24  main64C: main.go testlib
    25  	rm -f main64C
    26  	-CGO_ENABLED=0 go build $(GO_GCFLAGS) -o main64C main.go && LD_LIBRARY_PATH=testlib ./main64C a b c
    27  
    28  clean:
    29  	rm -rf main32 main64 main32C main64C
    30  	$(MAKE) -C testlib clean
    31  
    32  .PHONY: main clean main32 main64 testlib