Makefile | 35 ++++++++++++++++------------------- 1 files changed, 16 insertions(+), 19 deletions(-) diff --git a/Makefile b/Makefile index 74453f2..28a3b7d 100644 --- a/Makefile +++ b/Makefile @@ -37,15 +37,15 @@ AR =ar STRIP =strip MKDIR =mkdir -all: $(BINDIR) $(BINDIR)/multimon $(BINDIR)/gen +all: multimon gen -$(BINDIR)/%.s: %.c +%.s: %.c $(CC) $(CFLAGS) -S -o $@ $< -$(BINDIR)/%.o: $(BINDIR)/%.s +%.o: %.s $(AS) -c -o $@ $< -$(BINDIR)/%.o: %.c +%.o: %.c $(CC) $(CFLAGS) -c -o $@ $< SRC_L2 =hdlc.c pocsag.c @@ -57,26 +57,23 @@ SRC_MISC =unixinput.c costabf.c xdisplay.c SRC_GEN =gen.c gen_dtmf.c gen_sin.c gen_zvei.c gen_hdlc.c costabi.c -OBJ_L2 =$(SRC_L2:%.c=$(BINDIR)/%.o) -OBJ_L1 =$(SRC_L1:%.c=$(BINDIR)/%.o) -OBJ_MISC =$(SRC_MISC:%.c=$(BINDIR)/%.o) +OBJ_L2 =$(SRC_L2:%.c=%.o) +OBJ_L1 =$(SRC_L1:%.c=%.o) +OBJ_MISC =$(SRC_MISC:%.c=%.o) -OBJ_GEN =$(SRC_GEN:%.c=$(BINDIR)/%.o) +OBJ_GEN =$(SRC_GEN:%.c=%.o) -$(BINDIR): - $(MKDIR) $(BINDIR) - -$(BINDIR)/multimon: $(OBJ_L2) $(OBJ_L1) $(OBJ_MISC) +multimon: $(OBJ_L2) $(OBJ_L1) $(OBJ_MISC) $(CC) $(LDFLAGS) $^ $(LIBS) $(LIBSX) -o $@ -$(BINDIR)/gen: $(OBJ_GEN) +gen: $(OBJ_GEN) $(CC) $(LDFLAGS) $^ $(LIBS) -o $@ -$(BINDIR)/mkcostab: $(BINDIR)/mkcostab.o +mkcostab: mkcostab.o $(CC) $(LDFLAGS) $^ $(LIBS) -o $@ -costabi.c costabf.c: $(BINDIR)/mkcostab - $(BINDIR)/mkcostab +costabi.c costabf.c: mkcostab + ./mkcostab clean: $(RM) -f core `find . -name '*.[oas]' -print` @@ -85,8 +82,8 @@ clean: depend dep: - $(CPP) -M $(CFLAGS) $(SRC_MISC) $(SRC_L1) $(SRC_L2) $(SRC_GEN) mkcostab.c > $(BINDIR)/.depend + $(CPP) -M $(CFLAGS) $(SRC_MISC) $(SRC_L1) $(SRC_L2) $(SRC_GEN) mkcostab.c > .depend -ifeq ($(BINDIR)/.depend,$(wildcard $(BINDIR)/.depend)) -include $(BINDIR)/.depend +ifeq (.depend,$(wildcard .depend)) +include .depend endif