makefile supports nested dirs now
This commit is contained in:
5
Makefile
5
Makefile
@@ -7,13 +7,14 @@ CFLAGS=-Wall -Wextra -fPIC -O3
|
||||
TARGET=libgravity.so
|
||||
TEST_TARGET=testapp
|
||||
|
||||
SRCS=$(wildcard $(SRC)/*.c)
|
||||
SRCS=$(shell find $(SRC) -name '*.c')
|
||||
OBJS=$(patsubst $(SRC)/%.c,$(OBJ)/%.o,$(SRCS))
|
||||
|
||||
$(TARGET): $(OBJS)
|
||||
$(CC) -shared $(OBJS) -o $(TARGET)
|
||||
|
||||
$(OBJ)/%.o: $(SRC)/%.c
|
||||
@mkdir -p $(dir $@)
|
||||
$(CC) $(CFLAGS) -c $< -o $@
|
||||
|
||||
$(TEST_TARGET): test.c $(TARGET)
|
||||
@@ -25,7 +26,7 @@ setup:
|
||||
mkdir -p $(OBJ)
|
||||
|
||||
clean:
|
||||
rm -r $(OBJ)/*.o
|
||||
find $(OBJ) -name '*.o' -delete
|
||||
rm $(TARGET)
|
||||
rm $(TEST_TARGET)
|
||||
|
||||
|
||||
14
src/generator.h
Normal file
14
src/generator.h
Normal file
@@ -0,0 +1,14 @@
|
||||
#ifndef __GRAVITY__GENERATOR_H
|
||||
#define __GRAVITY__GENERATOR_H
|
||||
|
||||
#include "module.h"
|
||||
|
||||
typedef struct GravityOpaqueGenerator* GravityGenerator;
|
||||
struct GravityOpaqueGenerator {
|
||||
GravityModule module;
|
||||
char* (*generateAssembly)(GravityGenerator self);
|
||||
};
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
1
src/generators/linux_x86-64.c
Normal file
1
src/generators/linux_x86-64.c
Normal file
@@ -0,0 +1 @@
|
||||
#include "../generator.h"
|
||||
Reference in New Issue
Block a user