1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57
|
CONFETTI=../confetti
NAME=my_product
CFG=example.cfgtmpl
CC=gcc
CFLAGS=-Wall -g -O0 -Werror -std=gnu99
INCLUDE=-I.
LIB=
example_OBJS=example.o my_product_cfg.o prscfg.o
example_buffer_OBJS=example_buffer.o my_product_cfg.o prscfg.o
all: $(NAME).cfg example example_buffer
example.c: $(NAME)_cfg.h prscfg.h
example_buffer.c: $(NAME)_cfg.h prscfg.h
.SUFFIXES: .o.c
.c.o:
$(CC) $(CFLAGS) $(INCLUDE) -c $<
example: $(example_OBJS)
$(CC) -o $@ $(example_OBJS) $(LIB)
example_buffer: $(example_buffer_OBJS)
$(CC) -o $@ $(example_buffer_OBJS) $(LIB)
$(NAME).cfg: $(CFG)
$(CONFETTI) -i $< -n $(NAME) -f $@
$(NAME)_cfg.c: $(CFG)
$(CONFETTI) -i $< -n $(NAME) -c $@
$(NAME)_cfg.h: $(CFG)
$(CONFETTI) -i $< -n $(NAME) -h $@
prscfg.c: $(CFG)
$(CONFETTI) -i $< -p $@
prscfg.h: $(CFG)
$(CONFETTI) -i $< -H $@
prscfg.c: prscfg.h $(NAME)_cfg.h
$(NAME)_cfg.c: prscfg.h $(NAME)_cfg.h
clean:
rm -f $(NAME).cfg $(NAME)_cfg.c $(NAME)_cfg.h
rm -f prscfg.c prscfg.h
rm -f $(example_OBJS) $(example_buffer_OBJS)
rm -f example example_buffer *core
|