# tools
CC := gcc
RM := rm -f

# flags
CFLAGS := -ggdb
LDFLAGS :=
LDLIBS :=

# sources
sources := target1.c target2.c target3.c target4.c target5.c
targets := target1 target2 target3 target4 target5 

# gmake magic
.PHONY: default all clean

#targets
default: all
all: $(targets)

clean:
	$(RM) $(targets) $(sources:.c=.o)

install: all
	cp target? /tmp
	chown root:root /tmp/target?
	chmod 4755 /tmp/target?
	cp target?.c /tmp
	chmod a+r /tmp/target?.c

