diff options
author | Karel Kočí <karel.koci@nic.cz> | 2017-02-16 13:44:36 +0100 |
---|---|---|
committer | Karel Kočí <karel.koci@nic.cz> | 2017-02-16 13:44:36 +0100 |
commit | c2adfd2f707be8f4fca0f0cbdd45802206141c18 (patch) | |
tree | 1067b7ac1baef2b74690bf0594e4437122e6bbcd /deactivated/test-curl/test/Makefile | |
parent | 9f0f3e1b06456f43bc02e00839238a664b4ee6fe (diff) | |
download | turris-myrepo-c2adfd2f707be8f4fca0f0cbdd45802206141c18.tar.gz turris-myrepo-c2adfd2f707be8f4fca0f0cbdd45802206141c18.tar.bz2 turris-myrepo-c2adfd2f707be8f4fca0f0cbdd45802206141c18.zip |
Deactivate curl-test
Diffstat (limited to 'deactivated/test-curl/test/Makefile')
-rw-r--r-- | deactivated/test-curl/test/Makefile | 94 |
1 files changed, 94 insertions, 0 deletions
diff --git a/deactivated/test-curl/test/Makefile b/deactivated/test-curl/test/Makefile new file mode 100644 index 0000000..e1a5035 --- /dev/null +++ b/deactivated/test-curl/test/Makefile @@ -0,0 +1,94 @@ +# vim:ts=4:sw=4:noexpandtab +MAKEFLAGS += --no-builtin-rules + +# This variable can be overwritten to show executed commands +Q ?= @ + +# Default output path. This is used when output (writable) directory is different +# than project directory. You shouldn't be setting it by hand, but it is used in +# external Makefiles. +O ?= . + +# Load configuration +-include $(O)/.config.mk + +.PHONY: all +all: $(O)/test + +ifeq ($(DEBUG),yes) +CFLAGS += -ggdb -DDEBUG +endif +CFLAGS += -Wall +CFLAGS += -include $(O)/build/config.h +LDFLAGS += -lcurl -levent + +# Apply CPREFIX +CC:=$(CPREFIX)$(CC) + +### Source files list ########################### +SRC = test.c +### End of source files list #################### + +CSRC = $(patsubst %,src/%,$(filter %.c,$(SRC))) + +OBJ = $(patsubst src/%.c,$(O)/build/%.o,$(CSRC)) +DEP = $(patsubst src/%.c,$(O)/build/%.d,$(CSRC)) + +.PHONY: help +help: + @echo "General extendable macro language make targets:" + @echo " all|test - Build geml executable" + @echo " help - Prints this text help." + @echo " clean - Cleans builded files" + @echo " distclean - Same as clean but also removes distributed generated files" + @echo "Some enviroment variables to be defined:" + @echo " Q - Define emty to show executed commands" + +# Cleaning +.PHONY: clean +clean:: + @echo " CLEAN build" + $(Q)$(RM) -r $(O)/build + @echo " CLEAN test" + $(Q)$(RM) $(O)/test +.PHONY: distclean +distclean:: clean + @echo " CLEAN configuration" + $(Q)$(RM) $(O)/.config + +## Building targets ## +ifeq (,$(filter clean distclean help docs serve-docs clean-docs \ + ,$(MAKECMDGOALS))) # Ignore build targets if goal is not building + +ifeq ($(DEBUG),yes) +-include $(DEP) # If developing, use dependencies from source files +.PHONY: dependency dep +dependency dep:: $(DEP) +$(DEP): $(O)/build/%.d: src/%.c + @mkdir -p "$(@D)" + @echo " DEP $@" + $(Q)$(CC) -MM -MG -MT '$*.o $@' $(CFLAGS) $< -MF $@ +endif # DEBUG + +$(O)/test: $(OBJ) + @echo " LD $@" + $(Q)$(CC) $(LDFLAGS) $^ -o $@ + +$(OBJ): $(O)/build/%.o: src/%.c $(O)/build/config.h + @mkdir -p "$(@D)" + @echo " CC $@" + $(Q)$(CC) -c $(CFLAGS) $< -o $@ + +$(O)/build/config.h: $(O)/.config + @mkdir -p "$(@D)" + @echo " CONF $@" + $(Q)$(O)/configure --op-h > $@ +endif + +## Configuation files ## +$(O)/.config: + $(error Please run configure script first) + +$(O)/.config.mk: $(O)/.config + @echo " CONF $@" + $(Q)$(O)/configure --op-makefile > $@ |