BlinkenArea - GitList
Repositories
Blog
Wiki
libflexipix
Code
Commits
Branches
Tags
Search
Tree:
8fa4cc8
Branches
Tags
master
v1.0.0
v1.0.1
v1.0.2
v1.0.3
v1.0.4
v1.0.5
v1.0.6
v1.0.7
v1.0.8
libflexipix
config_gen
Makefile
add config file generator
Stefan Schuermans
commited
8fa4cc8
at 2016-12-21 10:31:43
Makefile
Blame
History
Raw
# FlexiPix config file generator # # Copyright 2010 Stefan Schuermans <stefan schuermans info> TARGET := flexipix_config_gen VER := 1 VERMIN := 0 VERREV := 1 SRCS := $(wildcard src/*.cpp) CPP := g++ INSTALL := install CFLAGS := -W -Wall -O3 DEFINES := -DFLPCG_VER_MAJ=$(VER) -DFLPCG_VER_MIN=$(VERMIN) \ -DFLPCG_VER_REV=$(VERREV) INCLUDES := LDFLAGS := LIBS := -ldime -lm SRCS_BASE := $(patsubst %.cpp,%,$(SRCS)) DEPS := $(addsuffix .d,$(SRCS_BASE)) OBJS := $(addsuffix .o,$(SRCS_BASE)) TGT := src/$(TARGET) VERSION := $(VER).$(VERMIN).$(VERREV) ENV_PREFIX := $(shell echo $$PREFIX) STOW_DIR := /usr/local/stow STOW_PREFIX := $(STOW_DIR)/flpConfigGen-$(VERSION) DEF_PREFIX := /usr/local ifneq ($(ENV_PREFIX),) PREFIX := $(ENV_PREFIX) else ifeq ($(shell if [ -d $(STOW_DIR) ]; then echo stow; fi),stow) PREFIX := $(STOW_PREFIX) else PREFIX := $(DEF_PREFIX) endif endif .PHONY: all clean install uninstall .SECONDARY: .SUFFIXES: all: $(DEPS) $(TGT) ifneq ($(MAKECMDGOALS),clean) -include $(DEPS) endif %.d: %.cpp $(CPP) $(CFLAGS) $(DEFINES) $(INCLUDES) -M -o $@ $< sed -i 's!^$(basename $(notdir $<))!$(dir $<)&!' $@ %.o: %.cpp Makefile $(CPP) $(CFLAGS) $(DEFINES) $(INCLUDES) -c -o $@ $< $(TGT): $(OBJS) $(CPP) $(LDFLAGS) -o $@ $+ $(LIBS) clean: rm -f $(DEPS) $(OBJS) $(TGT) install: all $(INSTALL) -d $(PREFIX)/bin $(INSTALL) -m 755 -t $(PREFIX)/bin $(TGT) uninstall: rm -f $(PREFIX)/bin/$(notdir $(TGT))