2019-05-15 18:30:14 +02:00
|
|
|
BIN = bin
|
|
|
|
OBJ = obj
|
|
|
|
DIRS = $(BIN) $(OBJ)
|
2019-05-15 18:10:18 +02:00
|
|
|
CFLAGS = -g -O -W -Wall
|
2019-05-15 16:55:03 +02:00
|
|
|
|
2019-05-15 18:56:59 +02:00
|
|
|
PERL = $(addprefix $(BIN)/, bootstrap bootstrap2 makemanifest psgen sortpages yapp)
|
2019-05-15 18:10:18 +02:00
|
|
|
BINS = $(addprefix $(BIN)/, unmunge munge repair)
|
|
|
|
UNMUNGE_OBJS = $(addprefix $(OBJ)/, util.o unmunge.o)
|
|
|
|
MUNGE_OBJS = $(addprefix $(OBJ)/, util.o munge.o)
|
|
|
|
REPAIR_OBJS = $(addprefix $(OBJ)/, util.o heap.o mempool.o subst.o repair.o)
|
2019-05-15 16:55:03 +02:00
|
|
|
|
2019-05-15 18:30:14 +02:00
|
|
|
$(shell mkdir -p $(DIRS))
|
|
|
|
|
2019-05-15 18:56:59 +02:00
|
|
|
all: $(BINS) $(PERL)
|
|
|
|
|
|
|
|
$(BIN)/%: %.pl
|
|
|
|
cp $< $@; chmod +x $@
|
2019-05-15 16:55:03 +02:00
|
|
|
|
2019-05-15 18:10:18 +02:00
|
|
|
$(BIN)/unmunge: $(UNMUNGE_OBJS)
|
|
|
|
$(CC) $(CFLAGS) -o $@ $(UNMUNGE_OBJS)
|
2019-05-15 16:55:03 +02:00
|
|
|
|
2019-05-15 18:10:18 +02:00
|
|
|
$(BIN)/munge: $(MUNGE_OBJS)
|
|
|
|
$(CC) $(CFLAGS) -o $@ $(MUNGE_OBJS)
|
2019-05-15 16:55:03 +02:00
|
|
|
|
2019-05-15 18:10:18 +02:00
|
|
|
$(BIN)/repair: $(REPAIR_OBJS)
|
|
|
|
$(CC) $(CFLAGS) -o $@ $(REPAIR_OBJS)
|
2019-05-15 16:55:03 +02:00
|
|
|
|
2019-05-15 18:10:18 +02:00
|
|
|
$(OBJ)/%.o: %.c
|
|
|
|
$(CC) $(CFLAGS) -c -o $@ $<
|
2019-05-15 16:55:03 +02:00
|
|
|
|
|
|
|
clean:
|
2019-05-15 18:10:18 +02:00
|
|
|
rm -f $(OBJ)/* $(BIN)/*.core
|
|
|
|
|
|
|
|
cleaner:
|
2019-05-15 18:30:14 +02:00
|
|
|
rm -rf $(DIRS)
|