# +-------------------------------------------------------------------------+
# |                           loghorn vers. 0.1.01                          |
# |    Copyright (c) Andrey V. Stolyarov  <croco at croco dot net>  2026    |
# | ----------------------------------------------------------------------- |
# | This is free software.  Permission is granted to everyone to use, copy  |
# |    or modify this software under the terms and conditions of either     |
# |             CROCO'S INDIVIDUALISTIC FREE SOFTWARE LICENSE               |
# |                          or, at your option,                            |
# |               GNU LESSER GENERAL PUBLIC LICENSE, v. 2.1                 |
# |                                                                         |
# | Please visit http://www.croco.net/software/loghorn  to get a fresh copy |
# | ----------------------------------------------------------------------- |
# |   This code is provided strictly and exclusively on the "AS IS" basis.  |
# |        THERE IS NO WARRANTY OF ANY KIND, DON'T EVEN THINK ABOUT IT      |
# +-------------------------------------------------------------------------+




CC = gcc
CFLAGS = -g -Wall -O0

CSOURCES = servlog.c message.c
HEADERS = $(CSOURCES:.c=.h)
OBJECTS = $(CSOURCES:.c=.o)

default: libloghorn.a
	:

%.o:	%.c
	$(CC) $(CFLAGS) -c $<

libloghorn.a:	$(OBJECTS)
	$(AR) crs $@ $^ 

_version.h:      Version
	echo '#define LOGHORN_VERSION "'`head -1 Version`'"' > $@
	echo '#define LOGHORN_VERSIONID '`tail -1 Version` >> $@

clean:
	rm -f *.o *.bin *.a *~ _version.h buf deps.mk

deps.mk: $(CSOURCES) $(CXXSOURCES) Makefile
	$(CC) -MM $(CSOURCES) > $@

ifneq (clean, $(MAKECMDGOALS))
ifneq (tags, $(MAKECMDGOALS))
-include deps.mk
endif
endif
