Skip to content

Commit

Permalink
Get rid of include and src directories
Browse files Browse the repository at this point in the history
This way do do not need a -I compilation flag to find the ptracer.h
and we don't need to discuss what is the name of the include directory.
  • Loading branch information
hugomg committed Aug 9, 2024
1 parent 7cec24a commit 65461d1
Show file tree
Hide file tree
Showing 11 changed files with 26 additions and 26 deletions.
32 changes: 16 additions & 16 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ INSTALL_DATA= $(INSTALL) -m 0644

# C compilation flags
CFLAGS = -DPT_DEBUG -O2 -std=c99 -pedantic -Wall -Wextra
CPPFLAGS = -I$(LUA_INCDIR) -Iinclude
CPPFLAGS = -I$(LUA_INCDIR)
LIBFLAG = -fPIC -shared

# The -Wl,-E tells the linker to not throw away unused Lua API symbols.
Expand All @@ -36,7 +36,7 @@ PTRUN_LDLIBS = -llua -lm
.PHONY: library examples tests all install uninstall clean

library: \
src/pt-run
pt-run

examples: library \
examples/fibonacci/fibonacci.so
Expand All @@ -50,30 +50,30 @@ tests: library \
spec/tracebacks/multimod/module_b.so \
spec/tracebacks/singular/module.so

all: library examples specs
all: library examples tests

install: src/pt-run include/ptracer.h
$(INSTALL_EXEC) src/pt-run $(BINDIR)
$(INSTALL_DATA) include/ptracer.h $(INCDIR)
install: pt-run ptracer.h
$(INSTALL_EXEC) pt-run $(BINDIR)
$(INSTALL_DATA) ptracer.h $(INCDIR)

uninstall:
rm -rf $(INCDIR)/ptracer.h
rm -rf $(BINDIR)/pt-run

clean:
rm -rf src/pt-run examples/*/*.so spec/tracebacks/*/*.so
rm -rf pt-run examples/*/*.so spec/tracebacks/*/*.so

%.so: %.c
$(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) $(LIBFLAG) $< -o $@

src/pt-run: src/pt-run.c include/ptracer.h
pt-run: pt-run.c ptracer.h
$(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) $(PTRUN_LDFLAGS) $< -o $@ $(PTRUN_LDLIBS)

examples/fibonacci/fibonacci.so: examples/fibonacci/fibonacci.c include/ptracer.h
spec/tracebacks/anon_lua/module.so: spec/tracebacks/anon_lua/module.c include/ptracer.h
spec/tracebacks/depth_recursion/module.so: spec/tracebacks/depth_recursion/module.c include/ptracer.h
spec/tracebacks/dispatch/module.so: spec/tracebacks/dispatch/module.c include/ptracer.h
spec/tracebacks/ellipsis/module.so: spec/tracebacks/ellipsis/module.c include/ptracer.h
spec/tracebacks/multimod/module_a.so: spec/tracebacks/multimod/module_a.c include/ptracer.h
spec/tracebacks/multimod/module_b.so: spec/tracebacks/multimod/module_b.c include/ptracer.h
spec/tracebacks/singular/module.so: spec/tracebacks/singular/module.c include/ptracer.h
examples/fibonacci/fibonacci.so: examples/fibonacci/fibonacci.c ptracer.h
spec/tracebacks/anon_lua/module.so: spec/tracebacks/anon_lua/module.c ptracer.h
spec/tracebacks/depth_recursion/module.so: spec/tracebacks/depth_recursion/module.c ptracer.h
spec/tracebacks/dispatch/module.so: spec/tracebacks/dispatch/module.c ptracer.h
spec/tracebacks/ellipsis/module.so: spec/tracebacks/ellipsis/module.c ptracer.h
spec/tracebacks/multimod/module_a.so: spec/tracebacks/multimod/module_a.c ptracer.h
spec/tracebacks/multimod/module_b.so: spec/tracebacks/multimod/module_b.c ptracer.h
spec/tracebacks/singular/module.so: spec/tracebacks/singular/module.c ptracer.h
6 changes: 3 additions & 3 deletions examples/fibonacci/fibonacci.c
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
/*
/*
* Copyright (c) 2024, The Pallene Developers
* Pallene Tracer is licensed under the MIT license.
* Please refer to the LICENSE and AUTHORS files for details
* SPDX-License-Identifier: MIT
* SPDX-License-Identifier: MIT
*/

#define PT_IMPLEMENTATION
#include <ptracer.h>
#include "ptracer.h"

/* User specific macros when Pallene Tracer debug mode is enabled. */
#ifdef PT_DEBUG
Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion spec/tracebacks/anon_lua/module.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

/* Static use of the library would suffice. */
#define PT_IMPLEMENTATION
#include <ptracer.h>
#include "ptracer.h"

/* Here goes user specifc macros when Pallene Tracer debug mode is active. */
#ifdef PT_DEBUG
Expand Down
2 changes: 1 addition & 1 deletion spec/tracebacks/depth_recursion/module.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

/* Static use of the library would suffice. */
#define PT_IMPLEMENTATION
#include <ptracer.h>
#include "ptracer.h"

/* Here goes user specific macros when Pallene Tracer debug mode is active. */
#ifdef PT_DEBUG
Expand Down
2 changes: 1 addition & 1 deletion spec/tracebacks/dispatch/module.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

/* Static use of the library would suffice. */
#define PT_IMPLEMENTATION
#include <ptracer.h>
#include "ptracer.h"

/* Here goes user specific macros when Pallene Tracer debug mode is active. */
#ifdef PT_DEBUG
Expand Down
2 changes: 1 addition & 1 deletion spec/tracebacks/ellipsis/module.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

/* Static use of the library would suffice. */
#define PT_IMPLEMENTATION
#include <ptracer.h>
#include "ptracer.h"

/* Here goes user specific macros when Pallene Tracer debug mode is active. */
#ifdef PT_DEBUG
Expand Down
2 changes: 1 addition & 1 deletion spec/tracebacks/multimod/module_a.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/

#define PT_IMPLEMENTATION
#include <ptracer.h>
#include "ptracer.h"

#include "module_include.h"

Expand Down
2 changes: 1 addition & 1 deletion spec/tracebacks/multimod/module_b.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/

#define PT_IMPLEMENTATION
#include <ptracer.h>
#include "ptracer.h"

#include "module_include.h"

Expand Down
2 changes: 1 addition & 1 deletion spec/tracebacks/singular/module.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

/* Static use of the library would suffice. */
#define PT_IMPLEMENTATION
#include <ptracer.h>
#include "ptracer.h"

/* Here goes user specific macros when Pallene Tracer debug mode is active. */
#ifdef PT_DEBUG
Expand Down

0 comments on commit 65461d1

Please sign in to comment.