CC = gcc LD = ld CFLAGS = -Wall -g -MD LDFLAGS = CONF = linux-x86-64 V = @ -include conf/mk.local .DEFAULT_GOAL := all # defined by CONF SYSC = SYSS = MAINC = -include conf/mk.$(CONF) C=\ port/srv.c\ port/ctl.c\ port/buf.c\ port/msg.c\ port/type.c\ port/util.c\ port/hash.c\ port/err.c\ $(SYSC) S=\ $(SYSS) O=$(C:.c=.o) $(S:.s=.o) D=$(C:.c=.d) MAINO=$(MAINC:.c=.o) TARG=sctl sctl.o all: $(TARG) sctl: sctl.o $(MAINO) @echo + ld $@ $(V) $(CC) $(CFLAGS) -o $@ $^ sctl.o: $(O) @echo + ld $@ $(V) $(LD) $(LDFLAGS) -r -o $@ $^ .c.o: @echo + cc $< $(V) $(CC) $(CFLAGS) -c $< -o $(<:.c=.o) .s.o: @echo + cc $< $(V) $(CC) $(CFLAGS) -c $< -o $(<:.s=.o) -include $(D) archive: git archive --format=tar --prefix=sctl/ HEAD | gzip -c > ../sctl.tar.gz git.tar: tar -C .. -cz sctl > ../sctl.git.tar.gz clean: $(V) rm -f depend *~ core* $(D) $(MAINO) $(O) $(TARG)