1234567891011121314151617181920212223242526272829303132333435 |
- DIR_BUILD := build
- DIR_SRC := src
- NAME_PORJECT := PasswordGeneration
- NAME_HEDER := ArgsParser Testing_ArgsParser
- NAME_SOURCES := $(NAME_PORJECT) $(NAME_HEDER)
- FILES := $(addprefix $(DIR_SRC)/,$(NAME_SOURCES:=.c)) $(addprefix $(DIR_SRC)/,$(NAME_HEDER:=.h))
- CFLAGS := -g3 -O0 -Wall -Wstrict-prototypes -Wmissing-prototypes -Wshadow -Wconversion
- RUN_ARGS := Hello World Hello
- all: build
- run:
- ./${DIR_BUILD}/${NAME_PORJECT} ${RUN_ARGS}
- ${DIR_BUILD}/${NAME_PORJECT}:
- gcc ${CFLAGS} -o $@ $(FILES)
- build: check ${DIR_BUILD}/${NAME_PORJECT}
- clear:
- if [ -f "$(DIR_BUILD)/${NAME_PORJECT}" ]; then\
- rm ${DIR_BUILD}/${NAME_PORJECT};\
- fi
- check:
- if [ -d "$(DIR_BUILD)" ]; then\
- echo "DIR: $(DIR_BUILD) ok";\
- else\
- mkdir $(DIR_BUILD);\
- echo "DIR: $(DIR_BUILD) created";\
- fi
- .PHONY: all build clear check
|