Skip to content

Commit

Permalink
remove 'prefix' program altogether, add 'll.h' to HEADERS
Browse files Browse the repository at this point in the history
  • Loading branch information
uno20001 committed May 24, 2020
1 parent 2d55f76 commit 5affc8e
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 88 deletions.
4 changes: 2 additions & 2 deletions BSDmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ all: $(program)

.SUFFIXES: .o .c
.c.o:
$(CC) $(CFLAGS) $(DEFINES) -DPRIoff="\"`./prefix`d\"" -DVERSION="\"$(version)\"" -c $(.IMPSRC)
$(CC) $(CFLAGS) $(DEFINES) -DVERSION="\"$(version)\"" -c $(.IMPSRC)

$(OBJS): $(HEADERS) prefix
$(OBJS): $(HEADERS)

.include "rules.mk"
6 changes: 2 additions & 4 deletions GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,11 @@ ifdef DEBUG
DEFINES += -DDEBUG
endif

OFFPRFX = $(shell ./prefix)

OBJS = $(SRCS:.c=.o)

all: $(program)

%.o: %.c $(HEADERS) prefix
$(CC) $(CFLAGS) $(DEFINES) -DPRIoff="\"$(OFFPRFX)d\"" -DVERSION="\"$(version)\"" -c $<
%.o: %.c $(HEADERS)
$(CC) $(CFLAGS) $(DEFINES) -DVERSION="\"$(version)\"" -c $<

include rules.mk
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -65,5 +65,5 @@
program = mktorrent
version = 1.1

HEADERS = mktorrent.h
HEADERS = mktorrent.h ll.h
SRCS = ftw.c init.c sha1.c hash.c output.c main.c msg.c ll.c
75 changes: 0 additions & 75 deletions prefix.c

This file was deleted.

9 changes: 3 additions & 6 deletions rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,11 @@

.PHONY: strip indent clean install uninstall

prefix: prefix.c
$(CC) $(CFLAGS) $(DEFINES) $(LDFLAGS) $< -o $@

$(program): $(OBJS)
$(CC) $(CFLAGS) $(OBJS) -o $(program) $(LDFLAGS) $(LIBS)

allinone: $(SRCS) $(HEADERS) prefix
$(CC) $(CFLAGS) $(DEFINES) -DPRIoff="\"`./prefix`d\"" -DVERSION="\"$(version)\"" -DALLINONE main.c -o $(program) $(LDFLAGS) $(LIBS)
allinone: $(SRCS) $(HEADERS)
$(CC) $(CFLAGS) $(DEFINES) -DVERSION="\"$(version)\"" -DALLINONE main.c -o $(program) $(LDFLAGS) $(LIBS)

strip:
strip $(program)
Expand All @@ -33,7 +30,7 @@ indent:
indent -kr -i8 *.c *.h

clean:
rm -f $(program) prefix *.o *.c~ *.h~
rm -f $(program) *.o *.c~ *.h~

install: $(program)
$(INSTALL) -d $(DESTDIR)$(PREFIX)/bin
Expand Down

0 comments on commit 5affc8e

Please sign in to comment.