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

Commit

Permalink
Move testcentury into a new subdirectory tests/ with its own Makefile.
Browse files Browse the repository at this point in the history
The all target of tests/Makefile now runs testcentury.

More tests to be added.

Issue #3
  • Loading branch information
Rene Ladan committed Dec 5, 2017
1 parent 3e5097c commit 7e5f943
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 8 deletions.
9 changes: 1 addition & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,14 @@ JSON_C?=`pkg-config --cflags json-c`
JSON_L?=`pkg-config --libs json-c`

all: libdcf77.so dcf77pi dcf77pi-analyze readpin
test: testcentury

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
objbin=dcf77pi.o dcf77pi-analyze.o readpin.o testcentury.o
objbin=dcf77pi.o dcf77pi-analyze.o readpin.o

input.o: input.h
$(CC) -fpic $(CFLAGS) $(JSON_C) -c input.c -o $@
Expand Down Expand Up @@ -63,19 +62,13 @@ readpin.o: input.h
readpin: readpin.o libdcf77.so
$(CC) -o $@ readpin.o libdcf77.so $(JSON_L)

testcentury.o: calendar.h
testcentury: testcentury.o calendar.o
$(CC) -fpic $(CFLAGS) -c testcentury.c -o $@
$(CC) -o $@ testcentury.o calendar.o

doxygen:
doxygen

clean:
rm -f dcf77pi
rm -f dcf77pi-analyze
rm -f readpin
rm -f testcentury
rm -f $(objbin)
rm -f libdcf77.so $(objlib)

Expand Down
22 changes: 22 additions & 0 deletions tests/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Copyright 2017 René Ladan
# SPDX-License-Identifier: BSD-2-Clause

.PHONY: all clean test

all: test
test: testcentury
./testcentury

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

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

clean:
rm -f $(objbin) testcentury
File renamed without changes.

0 comments on commit 7e5f943

Please sign in to comment.