Browse - Programming Tips - How can I setup a Makefile for my Go CGI programs?

Date: 2019sep9
Language: Go
Keywords: golang

Q.  How can I setup a Makefile for my Go CGI programs?

A.
# Compiles hello.go -> hello.cgi ALL = hello.cgi all: $(ALL) install: all install $(ALL) /htdocs/hellogo clean: rm $(ALL) %.cgi : %.go go build -o $@ $< # For more compact exectable: # go build -ldflags "-s -w" -o $@ $<