Skip to content

Commit

Permalink
Update src and makefile to make the build process cleaner
Browse files Browse the repository at this point in the history
  • Loading branch information
antoine-royer committed Mar 23, 2023
1 parent 3b07ad7 commit c48bf6a
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 14 deletions.
11 changes: 6 additions & 5 deletions makefile
Original file line number Diff line number Diff line change
@@ -1,25 +1,26 @@
CC=gcc
CFLAGS=`pkg-config --cflags gtk+-3.0` `pkg-config --cflags sdl2 SDL2_image SDL2_ttf`
CFLAGS=-I. `pkg-config --cflags gtk+-3.0` `pkg-config --cflags sdl2 SDL2_image SDL2_ttf`
LDFLAGS=`pkg-config --libs gtk+-3.0` `pkg-config --libs sdl2 SDL2_image SDL2_ttf` -rdynamic -lnetcdf -lm

EXEC=ceilometer
SRC=src/main.c src/callbacks.c src/netcdf_api.c src/sdl_api.c src/colors.c
OBJ=$(SRC:.c=.o)
OBJ=$(SRC:%.c=build/%.o)

all: $(EXEC) clean
all: $(EXEC)

# Compilation Linux
$(EXEC): $(OBJ)
$(CC) -o $@ $^ $(LDFLAGS)

main.o : include/main.h

%.o: %.c
build/%.o: %.c
@mkdir -p $(dir $@)
$(CC) -o $@ -c $< $(CFLAGS)

# Nettoyage des sources
clean:
rm src/*.o
rm -rf build

clear:
sudo rm -r /usr/bin/ceilometer_data
Expand Down
6 changes: 3 additions & 3 deletions src/callbacks.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
#include <time.h>


#include "../include/callbacks.h"
#include "../include/netcdf_api.h"
#include "../include/sdl_api.h"
#include "include/callbacks.h"
#include "include/netcdf_api.h"
#include "include/sdl_api.h"


extern GtkBuilder *builder;
Expand Down
2 changes: 1 addition & 1 deletion src/colors.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "../include/colors.h"
#include "include/colors.h"

const uint8_t COLORS[1020][3] = {
{255, 0, 0},
Expand Down
3 changes: 2 additions & 1 deletion src/main.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include <stdio.h>
#include <gtk/gtk.h>
#include "../include/callbacks.h"
#include "include/main.h"
#include "include/callbacks.h"

GtkBuilder *builder;

Expand Down
4 changes: 2 additions & 2 deletions src/netcdf_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
#include <stdint.h>
#include <string.h>

#include "../include/netcdf_api.h"
#include "../include/sdl_api.h"
#include "include/netcdf_api.h"
#include "include/sdl_api.h"


extern GtkBuilder *builder;
Expand Down
4 changes: 2 additions & 2 deletions src/sdl_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
#include <math.h>
#include <SDL2/SDL_image.h>

#include "../include/sdl_api.h"
#include "../include/colors.h"
#include "include/sdl_api.h"
#include "include/colors.h"


void sdl_image(float *data, float *alt, float minimum, float maximum, const bool filter, const char *var, char *date, const size_t NTIME, const size_t NRANGE)
Expand Down

0 comments on commit c48bf6a

Please sign in to comment.