From 0b332411b6e74f25c9eaa3e975c596a62c30a79a Mon Sep 17 00:00:00 2001 From: tj Date: Fri, 15 Oct 2010 12:44:14 +0200 Subject: [PATCH] Replace broken Makefile --- example/Makefile | 31 +++++++++---------------------- 1 file changed, 9 insertions(+), 22 deletions(-) diff --git a/example/Makefile b/example/Makefile index cdf104c..05650bc 100644 --- a/example/Makefile +++ b/example/Makefile @@ -1,26 +1,13 @@ -all: $(GOARCH) +include $(GOROOT)/src/Make.inc -clean: clean_$(GOARCH) - rm test +OBJS := $(patsubst %.go,%.$O,$(wildcard *.go)) +OUT := $(patsubst %.$O,%,$(OBJS)) -386: - 8g test.go - 8l -o test test.8 +all: $(OBJS) -amd64: - 6g test.go - 6l -o test test.6 - -arm: - 5g test.go - 5l -o test test.5 - -clean_amd64: - rm *.6 - -clean_386: - rm *.8 - -clean_arm: - rm *.5 +%.$O: %.go + $(GC) $< + $(LD) -o $(patsubst %.$O,%,$@) $@ +clean: + rm -f *.$O $(OBJS) $(OUT)