diff options
| author | Albert Cervin <albert@acervin.com> | 2023-01-26 13:07:07 +0100 |
|---|---|---|
| committer | Albert Cervin <albert@acervin.com> | 2023-01-26 13:07:07 +0100 |
| commit | e65158a0326108d1fc724ee683b7fa900ef2671a (patch) | |
| tree | 9bad30b377a326e0d0e3101c4f96228ae7a41673 /targets.mk | |
| parent | 9a2b138a03e27d0f04101fe6ae3977d79518c513 (diff) | |
| download | dged-e65158a0326108d1fc724ee683b7fa900ef2671a.tar.gz dged-e65158a0326108d1fc724ee683b7fa900ef2671a.tar.xz dged-e65158a0326108d1fc724ee683b7fa900ef2671a.zip | |
More tests and documentation
Also, split out platform-specific parts and add mocks for tests.
Diffstat (limited to 'targets.mk')
| -rw-r--r-- | targets.mk | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/targets.mk b/targets.mk new file mode 100644 index 0000000..c130237 --- /dev/null +++ b/targets.mk @@ -0,0 +1,43 @@ +# dependency generation +.c.d: + $(CC) -MM $(CFLAGS) -MT $*.o $< > $@ + @sed -i 's,\($*\)\.o[ :]*,\1.o $@ : ,g' $@ + +.c.o: + $(CC) $(CFLAGS) -c $< -o $@ + + +dged: src/main.o libdged.a + $(CC) $(LDFLAGS) src/main.o libdged.a -o dged + +libdged.a: $(OBJS) $(PLATFORM_OBJS) + $(AR) -rc libdged.a $(OBJS) $(PLATFORM_OBJS) + +run-tests: $(TEST_OBJS) $(OBJS) + $(CC) $(LDFLAGS) $(TEST_OBJS) $(OBJS) -o run-tests + +check: run-tests + ./run-tests + +run: dged + ./dged + +debug: dged + gdb ./dged + +debug-tests: run-tests + gdb ./run-tests + +clean: + rm -f $(FILES) + rm -rf docs + +install: dged + install -d $(prefix)/bin + install -m 755 dged $(prefix)/bin/dged + + install -d $(prefix)/share/man/man1 + install -m 644 dged.1 $(prefix)/share/man/man1/dged.1 + +docs: + doxygen Doxyfile |
