Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F102435432
Makefile
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Thu, Feb 20, 17:04
Size
1 KB
Mime Type
text/x-makefile
Expires
Sat, Feb 22, 17:04 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
24356586
Attached To
R6625 Oncilla Simulation
Makefile
View Options
TARGET = oncilla-sim-wizard
ALL_SOURCES = $(wildcard *.go)
DESTDIR ?=
PREFIX ?= /usr/local
# Remove man.go
SOURCES = $(subst man.go,,$(ALL_SOURCES))
MAN_SOURCES = $(subst oncilla-sim-wizard.go,man.go,$(SOURCES))
INSTALLDIR = $(DESTDIR)$(PREFIX)
VERBOSE ?=
ifneq ($(V),)
vecho =
veecho =
else
vecho = @echo [$1] $2;
veecho = echo [$1] $2;
endif
GC ?= go
# RESOURCES = $(wildcard resources/*)
# SECTIONS = $(foreach i,$(RESOURCES),--add-section autobuild_res_$(notdir $(i))=$(i))
MANINSTALLDIR = $(INSTALLDIR)/share/man/man1
all: $(TARGET) $(TARGET).man
# previous was
#$(TARGET): $(SOURCES) $(RESOURCES)
# $(call vecho,GC,$@) $(GC) build -o $@ $(SOURCES) && \
# objcopy $(SECTIONS) $(TARGET)
$(TARGET): $(SOURCES) $(RESOURCES)
$(call vecho,GC,$@) $(GC) build -o $@ $(SOURCES) && \
objcopy $(SECTIONS) $(TARGET)
CLEANFILES = $(TARGET) $(TARGET).man .gen-man
clean:
$(call vecho,CLEAN,$(CLEANFILES)) rm -f $(CLEANFILES)
install: $(TARGET) $(TARGET).man
test -z "$(INSTALLDIR)/bin" || mkdir -p "$(INSTALLDIR)/bin" && \
install -c $(TARGET) "$(INSTALLDIR)/bin"; \
test -z "$(MANINSTALLDIR)" || mkdir -p "$(MANINSTALLDIR)" && \
install -c -m 644 $(TARGET).man "$(MANINSTALLDIR)/$(TARGET).1"
uninstall:
rm -f "$(INSTALLDIR)/bin/$(TARGET)"; \
rm -f "$(MANINSTALLDIR)/$(TARGET).1"
.gen-man: $(MAN_SOURCES)
$(call vecho,GC,$@) $(GC) build -o $@ $(MAN_SOURCES)
$(TARGET).man: .gen-man
$(call vecho,MAN,$@) ./.gen-man > $@
.PHONY: install clean all
Event Timeline
Log In to Comment