Skip to content
This repository has been archived by the owner on Feb 25, 2024. It is now read-only.

Commit

Permalink
Add empty test_bits1to14.c to the build and simply Makefiles a bit
Browse files Browse the repository at this point in the history
Issue #3
  • Loading branch information
Rene Ladan committed Dec 24, 2017
1 parent 1a6b480 commit 2e9eda7
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 7 deletions.
6 changes: 2 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,8 @@ all: libdcf77.so dcf77pi dcf77pi-analyze readpin

hdrlib=input.h decode_time.h decode_alarm.h setclock.h mainloop.h \
bits1to14.h calendar.h
srclib=input.c decode_time.c decode_alarm.c setclock.c mainloop.c \
bits1to14.c calendar.c
objlib=input.o decode_time.o decode_alarm.o setclock.o mainloop.o \
bits1to14.o calendar.o
srclib=${hdrlib:.h=.c}
objlib=${hdrlib:.h=.o}
objbin=dcf77pi.o dcf77pi-analyze.o readpin.o

input.o: input.h
Expand Down
13 changes: 10 additions & 3 deletions tests/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,27 @@

.PHONY: all clean test

objbin=testcentury.o test_bits1to14.o
exebin=${objbin:.o=}

all: test
test: testcentury
test: $(exebin)
./testcentury
./test_bits1to14

PREFIX?=.
ETCDIR?=etc/dcf77pi
CFLAGS+=-Wall -D_POSIX_C_SOURCE=200809L -DETCDIR=\"$(PREFIX)/$(ETCDIR)\" \
-g -std=c99
objbin=testcentury.o

testcentury.o: ../calendar.h
$(CC) -fpic $(CFLAGS) -I.. -c testcentury.c -o $@
testcentury: testcentury.o ../calendar.o
$(CC) -o $@ testcentury.o ../calendar.o
test_bits1to14.o: ../bits1to14.h
$(CC) -fpic $(CFLAGS) -I.. -c test_bits1to14.c -o $@
test_bits1to14: test_bits1to14.o ../bits1to14.o
$(CC) -o $@ test_bits1to14.o ../bits1to14.o

clean:
rm -f $(objbin) testcentury
rm -f $(objbin) $(exebin)
13 changes: 13 additions & 0 deletions tests/test_bits1to14.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// Copyright 2017 René Ladan
// SPDX-License-Identifier: BSD-2-Clause

#include "bits1to14.h"

#include <stdio.h>
#include <sysexits.h>

int
main(int argc, char *argv[])
{
return EX_OK;
}

0 comments on commit 2e9eda7

Please sign in to comment.