30 lines
668 B
Makefile
30 lines
668 B
Makefile
TARGET1 = alix-usv
|
|
TARGET2 = alix-usvd
|
|
|
|
CFLAGS = -Wall -O2 -MD -MP -MF $(*F).d
|
|
|
|
# ------
|
|
|
|
SRC1 := alix-usv.c logging.c unixsocket.c
|
|
SRC2 := alix-usvd.c configfile.c event.c logging.c pidfile.c signals.c unixsocket.c
|
|
SRC2 += usvdevice.c usvstate.c
|
|
|
|
all: $(TARGET1) $(TARGET2)
|
|
|
|
$(TARGET1): $(SRC1:.c=.o)
|
|
@echo " Linking file: $@"
|
|
@$(CC) $(CFLAGS) $^ -o $@ $(LDFLAGS) > /dev/null
|
|
|
|
$(TARGET2): $(SRC2:.c=.o)
|
|
@echo " Linking file: $@"
|
|
@$(CC) $(CFLAGS) $^ -o $@ $(LDFLAGS) > /dev/null
|
|
|
|
%.o: %.c
|
|
@echo " Building file: $<"
|
|
@$(CC) -c $(CFLAGS) $< -o $@
|
|
|
|
clean:
|
|
rm -rf $(TARGET1) $(TARGET2) *.o *.d *.log *.sock *.pid
|
|
|
|
-include $(shell find . -name \*.d 2> /dev/null)
|